ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newstringwith_gc
Last change
on this file since a0d9f94 was
51b7345,
checked in by Peter A. Buhr <pabuhr@…>, 10 years ago
|
initial commit
|
-
Property mode set to
100644
|
File size:
1.0 KB
|
Rev | Line | |
---|
[51b7345] | 1 | #ifndef IOSTREAM_H |
---|
| 2 | #define IOSTREAM_H |
---|
| 3 | |
---|
| 4 | typedef unsigned long streamsize_type; |
---|
| 5 | |
---|
| 6 | context ostream( dtype ostype ) |
---|
| 7 | { |
---|
| 8 | ostype *write( ostype *, const char *, streamsize_type ); |
---|
| 9 | int fail( ostype * ); |
---|
| 10 | }; |
---|
| 11 | |
---|
| 12 | context writeable( type T ) |
---|
| 13 | { |
---|
| 14 | forall( dtype ostype | ostream( ostype ) ) ostype * ?<<?( ostype *, T ); |
---|
| 15 | }; |
---|
| 16 | |
---|
| 17 | // implement writable for some intrinsic types |
---|
| 18 | |
---|
| 19 | forall( dtype ostype | ostream( ostype ) ) ostype * ?<<?( ostype *, char ); |
---|
| 20 | |
---|
| 21 | forall( dtype ostype | ostream( ostype ) ) ostype * ?<<?( ostype *, int ); |
---|
| 22 | |
---|
| 23 | forall( dtype ostype | ostream( ostype ) ) ostype * ?<<?( ostype *, const char * ); |
---|
| 24 | |
---|
| 25 | |
---|
| 26 | context istream( dtype istype ) |
---|
| 27 | { |
---|
| 28 | istype *read( istype *, char *, streamsize_type ); |
---|
| 29 | istype *unread( istype *, char ); |
---|
| 30 | int fail( istype * ); |
---|
| 31 | int eof( istype * ); |
---|
| 32 | }; |
---|
| 33 | |
---|
| 34 | context readable( type T ) |
---|
| 35 | { |
---|
| 36 | forall( dtype istype | istream( istype ) ) istype * ?<<?( istype *, T ); |
---|
| 37 | }; |
---|
| 38 | |
---|
| 39 | forall( dtype istype | istream( istype ) ) |
---|
| 40 | istype * ?>>?( istype *, char* ); |
---|
| 41 | |
---|
| 42 | forall( dtype istype | istream( istype ) ) |
---|
| 43 | istype * ?>>?( istype *, int* ); |
---|
| 44 | |
---|
| 45 | #endif /* #ifndef IOSTREAM_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.