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