Changes in libcfa/src/iostream.cfa [9d362a0:ad72c8b]
- File:
-
- 1 edited
-
libcfa/src/iostream.cfa (modified) (24 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/iostream.cfa
r9d362a0 rad72c8b 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Dec 24 18:33:40201813 // Update Count : 5 8912 // Last Modified On : Thu Dec 13 14:13:22 2018 13 // Update Count : 548 14 14 // 15 15 … … 33 33 } // ?|? 34 34 void ?|?( ostype & os, bool b ) { 35 (ostype &)(os | b);nl( os );35 (ostype)(os | b); if ( getANL( os ) ) nl( os ); 36 36 } // ?|? 37 37 … … 42 42 } // ?|? 43 43 void ?|?( ostype & os, char c ) { 44 (ostype &)(os | c);nl( os );44 (ostype)(os | c); if ( getANL( os ) ) nl( os ); 45 45 } // ?|? 46 46 … … 51 51 } // ?|? 52 52 void ?|?( ostype & os, signed char sc ) { 53 (ostype &)(os | sc);nl( os );53 (ostype)(os | sc); if ( getANL( os ) ) nl( os ); 54 54 } // ?|? 55 55 … … 60 60 } // ?|? 61 61 void ?|?( ostype & os, unsigned char usc ) { 62 (ostype &)(os | usc);nl( os );62 (ostype)(os | usc); if ( getANL( os ) ) nl( os ); 63 63 } // ?|? 64 64 … … 69 69 } // ?|? 70 70 void & ?|?( ostype & os, short int si ) { 71 (ostype &)(os | si);nl( os );71 (ostype)(os | si); if ( getANL( os ) ) nl( os ); 72 72 } // ?|? 73 73 … … 78 78 } // ?|? 79 79 void & ?|?( ostype & os, unsigned short int usi ) { 80 (ostype &)(os | usi);nl( os );80 (ostype)(os | usi); if ( getANL( os ) ) nl( os ); 81 81 } // ?|? 82 82 … … 87 87 } // ?|? 88 88 void & ?|?( ostype & os, int i ) { 89 (ostype &)(os | i);nl( os );89 (ostype)(os | i); if ( getANL( os ) ) nl( os ); 90 90 } // ?|? 91 91 … … 96 96 } // ?|? 97 97 void & ?|?( ostype & os, unsigned int ui ) { 98 (ostype &)(os | ui);nl( os );98 (ostype)(os | ui); if ( getANL( os ) ) nl( os ); 99 99 } // ?|? 100 100 … … 105 105 } // ?|? 106 106 void & ?|?( ostype & os, long int li ) { 107 (ostype &)(os | li);nl( os );107 (ostype)(os | li); if ( getANL( os ) ) nl( os ); 108 108 } // ?|? 109 109 … … 114 114 } // ?|? 115 115 void & ?|?( ostype & os, unsigned long int uli ) { 116 (ostype &)(os | uli);nl( os );116 (ostype)(os | uli); if ( getANL( os ) ) nl( os ); 117 117 } // ?|? 118 118 … … 123 123 } // ?|? 124 124 void & ?|?( ostype & os, long long int lli ) { 125 (ostype &)(os | lli);nl( os );125 (ostype)(os | lli); if ( getANL( os ) ) nl( os ); 126 126 } // ?|? 127 127 … … 132 132 } // ?|? 133 133 void & ?|?( ostype & os, unsigned long long int ulli ) { 134 (ostype &)(os | ulli);nl( os );134 (ostype)(os | ulli); if ( getANL( os ) ) nl( os ); 135 135 } // ?|? 136 136 … … 141 141 } // ?|? 142 142 void & ?|?( ostype & os, float f ) { 143 (ostype &)(os | f);nl( os );143 (ostype)(os | f); if ( getANL( os ) ) nl( os ); 144 144 } // ?|? 145 145 … … 150 150 } // ?|? 151 151 void & ?|?( ostype & os, double d ) { 152 (ostype &)(os | d);nl( os );152 (ostype)(os | d); if ( getANL( os ) ) nl( os ); 153 153 } // ?|? 154 154 … … 159 159 } // ?|? 160 160 void & ?|?( ostype & os, long double ld ) { 161 (ostype &)(os | ld);nl( os );161 (ostype)(os | ld); if ( getANL( os ) ) nl( os ); 162 162 } // ?|? 163 163 … … 168 168 } // ?|? 169 169 void & ?|?( ostype & os, float _Complex fc ) { 170 (ostype &)(os | fc);nl( os );170 (ostype)(os | fc); if ( getANL( os ) ) nl( os ); 171 171 } // ?|? 172 172 … … 177 177 } // ?|? 178 178 void & ?|?( ostype & os, double _Complex dc ) { 179 (ostype &)(os | dc);nl( os );179 (ostype)(os | dc); if ( getANL( os ) ) nl( os ); 180 180 } // ?|? 181 181 … … 186 186 } // ?|? 187 187 void & ?|?( ostype & os, long double _Complex ldc ) { 188 (ostype &)(os | ldc);nl( os );188 (ostype)(os | ldc); if ( getANL( os ) ) nl( os ); 189 189 } // ?|? 190 190 … … 228 228 } // ?|? 229 229 void ?|?( ostype & os, const char * str ) { 230 (ostype &)(os | str);nl( os );230 (ostype)(os | str); if ( getANL( os ) ) nl( os ); 231 231 } // ?|? 232 232 … … 257 257 } // ?|? 258 258 void ?|?( ostype & os, const void * p ) { 259 (ostype &)(os | p);nl( os );259 (ostype)(os | p); if ( getANL( os ) ) nl( os ); 260 260 } // ?|? 261 261 262 262 // manipulators 263 263 ostype & ?|?( ostype & os, ostype & (* manip)( ostype & ) ) { 264 (ostype &)(manip( os )); 264 (ostype)(manip( os )); 265 setNonl( os, false ); // ignore nonl in middle 265 266 return os; 266 267 } // ?|? 267 268 void ?|?( ostype & os, ostype & (* manip)( ostype & ) ) { 268 (ostype &)(manip( os ));269 if ( get Prt( os ) ) nl( os ); // something printed ?270 set Prt( os, false ); // turn off269 (ostype)(manip( os )); 270 if ( getANL( os ) && ! getNonl( os ) ) nl( os ); // ignore nl if nonl at end 271 setNonl( os, false ); 271 272 } // ?|? 272 273 273 274 ostype & sep( ostype & os ) { 274 return (ostype &)(os | sepGet( os ));275 return (ostype)(os | sepGet( os )); 275 276 } // sep 276 277 … … 280 281 281 282 ostype & nl( ostype & os ) { 282 (ostype &)(os | '\n'); 283 setPrt( os, false ); // turn off 283 (ostype)(os | '\n'); 284 284 setNL( os, true ); 285 285 flush( os ); … … 287 287 } // nl 288 288 289 void nl( ostype & os ) {290 if ( getANL( os ) ) (ostype &)(nl( os )); // implementation only291 else setPrt( os, false ); // turn off292 } // nl293 294 289 ostype & nonl( ostype & os ) { 295 set Prt( os, false ); // turn off290 setNonl( os, true ); // indicate nonl manipulator 296 291 return os; 297 292 } // nonl … … 331 326 forall( dtype ostype, otype T, ttype Params | writeable( T, ostype ) | { ostype & ?|?( ostype &, Params ); } ) { 332 327 ostype & ?|?( ostype & os, T arg, Params rest ) { 333 (ostype &)(os | arg);// print first argument328 (ostype)(os | arg); // print first argument 334 329 sepSetCur( os, sepGetTuple( os ) ); // switch to tuple separator 335 (ostype &)(os | rest); // print remaining arguments330 (ostype)(os | rest); // print remaining arguments 336 331 sepSetCur( os, sepGet( os ) ); // switch to regular separator 337 332 return os; 338 333 } // ?|? 339 334 void ?|?( ostype & os, T arg, Params rest ) { 340 // (ostype &)(?|?( os, arg, rest ));nl( os );341 (ostype &)(os | arg);// print first argument335 // (ostype)(?|?( os, arg, rest )); if ( getANL( os ) ) nl( os ); 336 (ostype)(os | arg); // print first argument 342 337 sepSetCur( os, sepGetTuple( os ) ); // switch to tuple separator 343 (ostype &)(os | rest); // print remaining arguments338 (ostype)(os | rest); // print remaining arguments 344 339 sepSetCur( os, sepGet( os ) ); // switch to regular separator 345 nl( os );340 if ( getANL( os ) ) nl( os ); 346 341 } // ?|? 347 342 } // distribution
Note:
See TracChangeset
for help on using the changeset viewer.