Changeset 86f384b for src/libcfa
- Timestamp:
- Jul 2, 2017, 10:49:41 AM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 307a732
- Parents:
- d395012
- Location:
- src/libcfa
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/iostream
rd395012 r86f384b 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S at Jul 1 16:37:52201713 // Update Count : 1 0812 // Last Modified On : Sun Jul 2 08:42:56 2017 13 // Update Count : 110 14 14 // 15 15 … … 26 26 const char * sepGetCur( ostype * ); // get current separator string 27 27 void sepSetCur( ostype *, const char * ); // set current separator string 28 _Bool lastSepOn( ostype * ); // last manipulator is setOn (context sensitive) 28 29 // public 29 30 void sepOn( ostype * ); // turn separator state on … … 31 32 _Bool sepDisable( ostype * ); // set default state to off, and return previous state 32 33 _Bool sepEnable( ostype * ); // set default state to on, and return previous state 33 _Bool lastSepOn( ostype * ); // last manipulator is setOn (context sensitive)34 34 35 35 const char * sepGet( ostype * ); // get separator string … … 44 44 ostype * write( ostype *, const char *, unsigned long int ); 45 45 int fmt( ostype *, const char fmt[], ... ); 46 }; 46 }; // ostream 47 47 48 48 trait writeable( otype T ) { 49 49 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, T ); 50 }; 50 }; // writeable 51 51 52 52 // implement writable for intrinsic types … … 104 104 istype * ungetc( istype *, char ); 105 105 int fmt( istype *, const char fmt[], ... ); 106 }; 106 }; // istream 107 107 108 108 trait readable( otype T ) { 109 109 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, T ); 110 }; 110 }; // readable 111 111 112 112 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, char * ); -
src/libcfa/iostream.c
rd395012 r86f384b 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S at Jul 1 16:37:51201713 // Update Count : 37 412 // Last Modified On : Sun Jul 2 08:54:02 2017 13 // Update Count : 375 14 14 // 15 15 … … 201 201 forall( dtype ostype, otype T, ttype Params | ostream( ostype ) | writeable( T ) | { ostype * ?|?( ostype *, Params ); } ) 202 202 ostype * ?|?( ostype * os, T arg, Params rest ) { 203 os | arg; // print first argument 203 204 sepSetCur( os, sepGetTuple( os ) ); // switch to tuple separator 204 os | arg; // print first argument205 205 os | rest; // print remaining arguments 206 206 sepSetCur( os, sepGet( os ) ); // switch to regular separator
Note: See TracChangeset
for help on using the changeset viewer.