ADT
aaron-thesis
arm-eh
ast-experimental
cleanup-dtors
ctor
deferred_resn
demangler
enum
forall-pointer-decay
gc_noraii
jacob/cs343-translation
jenkins-sandbox
memory
new-ast
new-ast-unique-expr
new-env
no_list
persistent-indexer
pthread-emulation
qualifiedEnum
resolv-new
string
stuck-waitfor-destruct
with_gc
|
Last change
on this file since a0d9f94 was 51b73452, checked in by Peter A. Buhr <pabuhr@…>, 11 years ago |
|
initial commit
|
-
Property mode
set to
100644
|
|
File size:
1.0 KB
|
| Line | |
|---|
| 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.