Changes in libcfa/src/iostream.cfa [467c8b7:fd54fef]
- File:
-
- 1 edited
-
libcfa/src/iostream.cfa (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/iostream.cfa
r467c8b7 rfd54fef 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jan 16 11:24:50 202113 // Update Count : 113 112 // Last Modified On : Mon Aug 24 08:31:35 2020 13 // Update Count : 1130 14 14 // 15 15 … … 36 36 37 37 38 forall( dtype ostype| ostream( ostype ) ) {38 forall( ostype & | ostream( ostype ) ) { 39 39 ostype & ?|?( ostype & os, bool b ) { 40 40 if ( $sepPrt( os ) ) fmt( os, "%s", $sepGetCur( os ) ); … … 399 399 return os; 400 400 } // nlOff 401 402 ostype & acquire( ostype & os ) {403 acquire( os ); // call void returning404 return os;405 } // nlOff406 401 } // distribution 407 402 408 403 // tuples 409 forall( dtype ostype, otype T, ttype Params| writeable( T, ostype ) | { ostype & ?|?( ostype &, Params ); } ) {404 forall( ostype &, T, Params... | writeable( T, ostype ) | { ostype & ?|?( ostype &, Params ); } ) { 410 405 ostype & ?|?( ostype & os, T arg, Params rest ) { 411 406 (ostype &)(os | arg); // print first argument … … 426 421 427 422 // writes the range [begin, end) to the given stream 428 forall( dtype ostype, otype elt_type | writeable( elt_type, ostype ), otypeiterator_type | iterator( iterator_type, elt_type ) ) {423 forall( ostype &, elt_type | writeable( elt_type, ostype ), iterator_type | iterator( iterator_type, elt_type ) ) { 429 424 void write( iterator_type begin, iterator_type end, ostype & os ) { 430 425 void print( elt_type i ) { os | i; } … … 447 442 // Default prefix for non-decimal prints is 0b, 0, 0x. 448 443 #define IntegralFMTImpl( T, IFMTNP, IFMTP ) \ 449 forall( dtype ostype| ostream( ostype ) ) { \444 forall( ostype & | ostream( ostype ) ) { \ 450 445 ostype & ?|?( ostype & os, _Ostream_Manip(T) f ) { \ 451 446 if ( $sepPrt( os ) ) fmt( os, "%s", $sepGetCur( os ) ); \ … … 540 535 // Default prefix for non-decimal prints is 0b, 0, 0x. 541 536 #define IntegralFMTImpl128( T, SIGNED, CODE, IFMTNP, IFMTP ) \ 542 forall( dtype ostype| ostream( ostype ) ) \537 forall( ostype & | ostream( ostype ) ) \ 543 538 static void base10_128( ostype & os, _Ostream_Manip(T) f ) { \ 544 539 if ( f.val > UINT64_MAX ) { \ … … 557 552 } /* if */ \ 558 553 } /* base10_128 */ \ 559 forall( dtype ostype| ostream( ostype ) ) { \554 forall( ostype & | ostream( ostype ) ) { \ 560 555 ostype & ?|?( ostype & os, _Ostream_Manip(T) f ) { \ 561 556 if ( $sepPrt( os ) ) fmt( os, "%s", $sepGetCur( os ) ); \ … … 659 654 #if defined( __SIZEOF_INT128__ ) 660 655 // Default prefix for non-decimal prints is 0b, 0, 0x. 661 forall( dtype ostype| ostream( ostype ) )656 forall( ostype & | ostream( ostype ) ) 662 657 static inline void base_128( ostype & os, unsigned int128 val, unsigned int128 power, _Ostream_Manip(uint64_t) & f, unsigned int maxdig, unsigned int bits, unsigned int cnt = 0 ) { 663 658 int wd = 1; // f.wd is never 0 because 0 implies left-pad … … 724 719 725 720 #define IntegralFMTImpl128( T ) \ 726 forall( dtype ostype| ostream( ostype ) ) { \721 forall( ostype & | ostream( ostype ) ) { \ 727 722 ostype & ?|?( ostype & os, _Ostream_Manip(T) f ) { \ 728 723 _Ostream_Manip(uint64_t) fmt; \ … … 772 767 773 768 #define FloatingPointFMTImpl( T, DFMTNP, DFMTP ) \ 774 forall( dtype ostype| ostream( ostype ) ) { \769 forall( ostype & | ostream( ostype ) ) { \ 775 770 ostype & ?|?( ostype & os, _Ostream_Manip(T) f ) { \ 776 771 if ( $sepPrt( os ) ) fmt( os, "%s", $sepGetCur( os ) ); \ … … 806 801 // *********************************** character *********************************** 807 802 808 forall( dtype ostype| ostream( ostype ) ) {803 forall( ostype & | ostream( ostype ) ) { 809 804 ostype & ?|?( ostype & os, _Ostream_Manip(char) f ) { 810 805 if ( f.base != 'c' ) { // bespoke binary/octal/hex format … … 839 834 // *********************************** C string *********************************** 840 835 841 forall( dtype ostype| ostream( ostype ) ) {836 forall( ostype & | ostream( ostype ) ) { 842 837 ostype & ?|?( ostype & os, _Ostream_Manip(const char *) f ) { 843 838 if ( ! f.val ) return os; // null pointer ? … … 887 882 888 883 889 forall( dtype istype| istream( istype ) ) {884 forall( istype & | istream( istype ) ) { 890 885 istype & ?|?( istype & is, bool & b ) { 891 886 char val[6]; … … 1053 1048 // *********************************** manipulators *********************************** 1054 1049 1055 forall( dtype istype| istream( istype ) )1050 forall( istype & | istream( istype ) ) 1056 1051 istype & ?|?( istype & is, _Istream_Cstr f ) { 1057 1052 // skip xxx … … 1088 1083 } // ?|? 1089 1084 1090 forall( dtype istype| istream( istype ) )1085 forall( istype & | istream( istype ) ) 1091 1086 istype & ?|?( istype & is, _Istream_Char f ) { 1092 1087 fmt( is, "%*c" ); // argument variable unused … … 1095 1090 1096 1091 #define InputFMTImpl( T, CODE ) \ 1097 forall( dtype istype| istream( istype ) ) \1092 forall( istype & | istream( istype ) ) \ 1098 1093 istype & ?|?( istype & is, _Istream_Manip(T) f ) { \ 1099 1094 enum { size = 16 }; \ … … 1124 1119 InputFMTImpl( long double, "Lf" ) 1125 1120 1126 forall( dtype istype| istream( istype ) )1121 forall( istype & | istream( istype ) ) 1127 1122 istype & ?|?( istype & is, _Istream_Manip(float _Complex) fc ) { 1128 1123 float re, im; … … 1135 1130 } // ?|? 1136 1131 1137 forall( dtype istype| istream( istype ) )1132 forall( istype & | istream( istype ) ) 1138 1133 istype & ?|?( istype & is, _Istream_Manip(double _Complex) dc ) { 1139 1134 double re, im; … … 1146 1141 } // ?|? 1147 1142 1148 forall( dtype istype| istream( istype ) )1143 forall( istype & | istream( istype ) ) 1149 1144 istype & ?|?( istype & is, _Istream_Manip(long double _Complex) ldc ) { 1150 1145 long double re, im;
Note:
See TracChangeset
for help on using the changeset viewer.