Changes in libcfa/src/iostream.cfa [dc5072f:65240bb]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/iostream.cfa
rdc5072f r65240bb 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jun 13 17:21:10201913 // Update Count : 81 212 // Last Modified On : Fri Jul 12 12:04:13 2019 13 // Update Count : 819 14 14 // 15 15 … … 30 30 31 31 32 //*********************************** Ostream ***********************************32 //*********************************** ostream *********************************** 33 33 34 34 … … 40 40 } // ?|? 41 41 void ?|?( ostype & os, zero_t z ) { 42 (ostype &)(os | z); nl( os );42 (ostype &)(os | z); ends( os ); 43 43 } // ?|? 44 44 … … 49 49 } // ?|? 50 50 void ?|?( ostype & os, one_t o ) { 51 (ostype &)(os | o); nl( os );51 (ostype &)(os | o); ends( os ); 52 52 } // ?|? 53 53 … … 58 58 } // ?|? 59 59 void ?|?( ostype & os, bool b ) { 60 (ostype &)(os | b); nl( os );60 (ostype &)(os | b); ends( os ); 61 61 } // ?|? 62 62 … … 67 67 } // ?|? 68 68 void ?|?( ostype & os, char c ) { 69 (ostype &)(os | c); nl( os );69 (ostype &)(os | c); ends( os ); 70 70 } // ?|? 71 71 … … 76 76 } // ?|? 77 77 void ?|?( ostype & os, signed char sc ) { 78 (ostype &)(os | sc); nl( os );78 (ostype &)(os | sc); ends( os ); 79 79 } // ?|? 80 80 … … 85 85 } // ?|? 86 86 void ?|?( ostype & os, unsigned char usc ) { 87 (ostype &)(os | usc); nl( os );87 (ostype &)(os | usc); ends( os ); 88 88 } // ?|? 89 89 … … 94 94 } // ?|? 95 95 void & ?|?( ostype & os, short int si ) { 96 (ostype &)(os | si); nl( os );96 (ostype &)(os | si); ends( os ); 97 97 } // ?|? 98 98 … … 103 103 } // ?|? 104 104 void & ?|?( ostype & os, unsigned short int usi ) { 105 (ostype &)(os | usi); nl( os );105 (ostype &)(os | usi); ends( os ); 106 106 } // ?|? 107 107 … … 112 112 } // ?|? 113 113 void & ?|?( ostype & os, int i ) { 114 (ostype &)(os | i); nl( os );114 (ostype &)(os | i); ends( os ); 115 115 } // ?|? 116 116 … … 121 121 } // ?|? 122 122 void & ?|?( ostype & os, unsigned int ui ) { 123 (ostype &)(os | ui); nl( os );123 (ostype &)(os | ui); ends( os ); 124 124 } // ?|? 125 125 … … 130 130 } // ?|? 131 131 void & ?|?( ostype & os, long int li ) { 132 (ostype &)(os | li); nl( os );132 (ostype &)(os | li); ends( os ); 133 133 } // ?|? 134 134 … … 139 139 } // ?|? 140 140 void & ?|?( ostype & os, unsigned long int uli ) { 141 (ostype &)(os | uli); nl( os );141 (ostype &)(os | uli); ends( os ); 142 142 } // ?|? 143 143 … … 148 148 } // ?|? 149 149 void & ?|?( ostype & os, long long int lli ) { 150 (ostype &)(os | lli); nl( os );150 (ostype &)(os | lli); ends( os ); 151 151 } // ?|? 152 152 … … 157 157 } // ?|? 158 158 void & ?|?( ostype & os, unsigned long long int ulli ) { 159 (ostype &)(os | ulli); nl( os );159 (ostype &)(os | ulli); ends( os ); 160 160 } // ?|? 161 161 … … 180 180 } // ?|? 181 181 void & ?|?( ostype & os, float f ) { 182 (ostype &)(os | f); nl( os );182 (ostype &)(os | f); ends( os ); 183 183 } // ?|? 184 184 … … 189 189 } // ?|? 190 190 void & ?|?( ostype & os, double d ) { 191 (ostype &)(os | d); nl( os );191 (ostype &)(os | d); ends( os ); 192 192 } // ?|? 193 193 … … 198 198 } // ?|? 199 199 void & ?|?( ostype & os, long double ld ) { 200 (ostype &)(os | ld); nl( os );200 (ostype &)(os | ld); ends( os ); 201 201 } // ?|? 202 202 … … 210 210 } // ?|? 211 211 void & ?|?( ostype & os, float _Complex fc ) { 212 (ostype &)(os | fc); nl( os );212 (ostype &)(os | fc); ends( os ); 213 213 } // ?|? 214 214 … … 222 222 } // ?|? 223 223 void & ?|?( ostype & os, double _Complex dc ) { 224 (ostype &)(os | dc); nl( os );224 (ostype &)(os | dc); ends( os ); 225 225 } // ?|? 226 226 … … 234 234 } // ?|? 235 235 void & ?|?( ostype & os, long double _Complex ldc ) { 236 (ostype &)(os | ldc); nl( os );236 (ostype &)(os | ldc); ends( os ); 237 237 } // ?|? 238 238 … … 276 276 } // ?|? 277 277 void ?|?( ostype & os, const char * str ) { 278 (ostype &)(os | str); nl( os );278 (ostype &)(os | str); ends( os ); 279 279 } // ?|? 280 280 … … 305 305 } // ?|? 306 306 void ?|?( ostype & os, const void * p ) { 307 (ostype &)(os | p); nl( os );307 (ostype &)(os | p); ends( os ); 308 308 } // ?|? 309 309 … … 315 315 void ?|?( ostype & os, ostype & (* manip)( ostype & ) ) { 316 316 (ostype &)(manip( os )); 317 if ( getPrt( os ) ) nl( os ); // something printed ?317 if ( getPrt( os ) ) ends( os ); // something printed ? 318 318 setPrt( os, false ); // turn off 319 319 } // ?|? … … 335 335 } // nl 336 336 337 void nl( ostype & os ) {338 if ( getANL( os ) ) (ostype &)(nl( os )); // implementation only339 else setPrt( os, false ); // turn off340 } // nl341 342 337 ostype & nonl( ostype & os ) { 343 338 setPrt( os, false ); // turn off … … 386 381 } // ?|? 387 382 void ?|?( ostype & os, T arg, Params rest ) { 388 // (ostype &)(?|?( os, arg, rest )); nl( os );383 // (ostype &)(?|?( os, arg, rest )); ends( os ); 389 384 (ostype &)(os | arg); // print first argument 390 385 sepSetCur( os, sepGetTuple( os ) ); // switch to tuple separator 391 386 (ostype &)(os | rest); // print remaining arguments 392 387 sepSetCur( os, sepGet( os ) ); // switch to regular separator 393 nl( os );388 ends( os ); 394 389 } // ?|? 395 390 } // distribution … … 408 403 } // distribution 409 404 410 //*********************************** Manipulators ***********************************411 412 //*********************************** Integral ***********************************405 //*********************************** manipulators *********************************** 406 407 //*********************************** integral *********************************** 413 408 414 409 static const char * shortbin[] = { "0", "1", "10", "11", "100", "101", "110", "111", "1000", "1001", "1010", "1011", "1100", "1101", "1110", "1111" }; … … 478 473 return os; \ 479 474 } /* ?|? */ \ 480 void ?|?( ostype & os, _Ostream_Manip(T) f ) { (ostype &)(os | f); nl( os ); } \475 void ?|?( ostype & os, _Ostream_Manip(T) f ) { (ostype &)(os | f); ends( os ); } \ 481 476 } // distribution 482 477 … … 492 487 IntegralFMTImpl( unsigned long long int, 'u', "% *ll ", "% *.*ll " ) 493 488 494 //*********************************** Floating Point ***********************************489 //*********************************** floating point *********************************** 495 490 496 491 #define PrintWithDP2( os, format, val, ... ) \ … … 541 536 return os; \ 542 537 } /* ?|? */ \ 543 void ?|?( ostype & os, _Ostream_Manip(T) f ) { (ostype &)(os | f); nl( os ); } \538 void ?|?( ostype & os, _Ostream_Manip(T) f ) { (ostype &)(os | f); ends( os ); } \ 544 539 } // distribution 545 540 … … 547 542 FloatingPointFMTImpl( long double, "% *L ", "% *.*L " ) 548 543 549 //*********************************** Character ***********************************544 //*********************************** character *********************************** 550 545 551 546 forall( dtype ostype | ostream( ostype ) ) { … … 576 571 return os; 577 572 } // ?|? 578 void ?|?( ostype & os, _Ostream_Manip(char) f ) { (ostype &)(os | f); nl( os ); }573 void ?|?( ostype & os, _Ostream_Manip(char) f ) { (ostype &)(os | f); ends( os ); } 579 574 } // distribution 580 575 581 //*********************************** C String ***********************************576 //*********************************** C string *********************************** 582 577 583 578 forall( dtype ostype | ostream( ostype ) ) { … … 621 616 return os; 622 617 } // ?|? 623 void ?|?( ostype & os, _Ostream_Manip(const char *) f ) { (ostype &)(os | f); nl( os ); }618 void ?|?( ostype & os, _Ostream_Manip(const char *) f ) { (ostype &)(os | f); ends( os ); } 624 619 } // distribution 625 620 626 621 627 //*********************************** Istream ***********************************622 //*********************************** istream *********************************** 628 623 629 624 … … 771 766 } // distribution 772 767 773 //*********************************** Manipulators ***********************************768 //*********************************** manipulators *********************************** 774 769 775 770 forall( dtype istype | istream( istype ) )
Note: See TracChangeset
for help on using the changeset viewer.