Changeset db94b5d for libcfa/src/iostream.hfa
- Timestamp:
- Jul 18, 2023, 1:25:21 PM (22 months ago)
- Branches:
- master
- Children:
- da6db1a2
- Parents:
- c44705c (diff), 5454d77 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified libcfa/src/iostream.hfa ¶
rc44705c rdb94b5d 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T hu Jun 29 11:07:25202313 // Update Count : 4 2712 // Last Modified On : Tue Jul 18 10:42:52 2023 13 // Update Count : 438 14 14 // 15 15 … … 74 74 // implement writable for intrinsic types 75 75 76 #define OSTYPE_VOID( T ) void ?|?( ostype &, T ) 77 #define OSTYPE_VOID_IMPL( T ) \ 78 void ?|?( ostype & os, T t ) { \ 79 (ostype &)(os | t); ends( os ); \ 80 } // ?|? 81 76 82 forall( ostype & | basic_ostream( ostype ) ) { 77 83 ostype & ?|?( ostype &, bool ); 78 void ?|?( ostype &,bool );84 OSTYPE_VOID( bool ); 79 85 80 86 ostype & ?|?( ostype &, char ); 81 void ?|?( ostype &,char );87 OSTYPE_VOID( char ); 82 88 ostype & ?|?( ostype &, signed char ); 83 void ?|?( ostype &,signed char );89 OSTYPE_VOID( signed char ); 84 90 ostype & ?|?( ostype &, unsigned char ); 85 void ?|?( ostype &,unsigned char );91 OSTYPE_VOID( unsigned char ); 86 92 87 93 ostype & ?|?( ostype &, short int ); 88 void ?|?( ostype &,short int );94 OSTYPE_VOID( short int ); 89 95 ostype & ?|?( ostype &, unsigned short int ); 90 void ?|?( ostype &,unsigned short int );96 OSTYPE_VOID( unsigned short int ); 91 97 ostype & ?|?( ostype &, int ); 92 void ?|?( ostype &,int );98 OSTYPE_VOID( int ); 93 99 ostype & ?|?( ostype &, unsigned int ); 94 void ?|?( ostype &,unsigned int );100 OSTYPE_VOID( unsigned int ); 95 101 ostype & ?|?( ostype &, long int ); 96 void ?|?( ostype &,long int );102 OSTYPE_VOID( long int ); 97 103 ostype & ?|?( ostype &, long long int ); 98 void ?|?( ostype &,long long int );104 OSTYPE_VOID( long long int ); 99 105 ostype & ?|?( ostype &, unsigned long int ); 100 void ?|?( ostype &,unsigned long int );106 OSTYPE_VOID( unsigned long int ); 101 107 ostype & ?|?( ostype &, unsigned long long int ); 102 void ?|?( ostype &,unsigned long long int );108 OSTYPE_VOID( unsigned long long int ); 103 109 #if defined( __SIZEOF_INT128__ ) 104 110 ostype & ?|?( ostype &, int128 ); 105 void ?|?( ostype &,int128 );111 OSTYPE_VOID( int128 ); 106 112 ostype & ?|?( ostype &, unsigned int128 ); 107 void ?|?( ostype &,unsigned int128 );113 OSTYPE_VOID( unsigned int128 ); 108 114 #endif // __SIZEOF_INT128__ 109 115 110 116 ostype & ?|?( ostype &, float ); 111 void ?|?( ostype &,float );117 OSTYPE_VOID( float ); 112 118 ostype & ?|?( ostype &, double ); 113 void ?|?( ostype &,double );119 OSTYPE_VOID( double ); 114 120 ostype & ?|?( ostype &, long double ); 115 void ?|?( ostype &,long double );121 OSTYPE_VOID( long double ); 116 122 117 123 ostype & ?|?( ostype &, float _Complex ); 118 void ?|?( ostype &,float _Complex );124 OSTYPE_VOID( float _Complex ); 119 125 ostype & ?|?( ostype &, double _Complex ); 120 void ?|?( ostype &,double _Complex );126 OSTYPE_VOID( double _Complex ); 121 127 ostype & ?|?( ostype &, long double _Complex ); 122 void ?|?( ostype &,long double _Complex );128 OSTYPE_VOID( long double _Complex ); 123 129 124 130 ostype & ?|?( ostype &, const char [] ); 125 void ?|?( ostype &,const char [] );131 OSTYPE_VOID( const char [] ); 126 132 // ostype & ?|?( ostype &, const char16_t * ); 127 133 #if ! ( __ARM_ARCH_ISA_ARM == 1 && __ARM_32BIT_STATE == 1 ) // char32_t == wchar_t => ambiguous … … 130 136 // ostype & ?|?( ostype &, const wchar_t * ); 131 137 ostype & ?|?( ostype &, const void * ); 132 void ?|?( ostype &,const void * );138 OSTYPE_VOID( const void * ); 133 139 134 140 // manipulators 135 141 ostype & ?|?( ostype &, ostype & (*)( ostype & ) ); 136 void ?|?( ostype &,ostype & (*)( ostype & ) );142 OSTYPE_VOID( ostype & (*)( ostype & ) ); 137 143 138 144 ostype & nl( ostype & ); … … 190 196 // initialized explicitly shall be initialized implicitly the same as objects that have static storage duration.*** 191 197 192 #define I ntegralFMTDecl( T, CODE ) \198 #define INTEGRAL_FMT_DECL( T, CODE ) \ 193 199 static inline { \ 194 200 _Ostream_Manip(T) bin( T val ) { return (_Ostream_Manip(T))@{ val, 1, 0, 'b', { .all : 0 } }; } \ … … 211 217 } // ?|? 212 218 213 I ntegralFMTDecl( signed char, 'd' )214 I ntegralFMTDecl( unsigned char, 'u' )215 I ntegralFMTDecl( signed short int, 'd' )216 I ntegralFMTDecl( unsigned short int, 'u' )217 I ntegralFMTDecl( signed int, 'd' )218 I ntegralFMTDecl( unsigned int, 'u' )219 I ntegralFMTDecl( signed long int, 'd' )220 I ntegralFMTDecl( unsigned long int, 'u' )221 I ntegralFMTDecl( signed long long int, 'd' )222 I ntegralFMTDecl( unsigned long long int, 'u' )219 INTEGRAL_FMT_DECL( signed char, 'd' ) 220 INTEGRAL_FMT_DECL( unsigned char, 'u' ) 221 INTEGRAL_FMT_DECL( signed short int, 'd' ) 222 INTEGRAL_FMT_DECL( unsigned short int, 'u' ) 223 INTEGRAL_FMT_DECL( signed int, 'd' ) 224 INTEGRAL_FMT_DECL( unsigned int, 'u' ) 225 INTEGRAL_FMT_DECL( signed long int, 'd' ) 226 INTEGRAL_FMT_DECL( unsigned long int, 'u' ) 227 INTEGRAL_FMT_DECL( signed long long int, 'd' ) 228 INTEGRAL_FMT_DECL( unsigned long long int, 'u' ) 223 229 #if defined( __SIZEOF_INT128__ ) 224 I ntegralFMTDecl( int128, 'd' )225 I ntegralFMTDecl( unsigned int128, 'u' )230 INTEGRAL_FMT_DECL( int128, 'd' ) 231 INTEGRAL_FMT_DECL( unsigned int128, 'u' ) 226 232 #endif // __SIZEOF_INT128__ 227 233 … … 229 235 230 236 // Default suffix for values with no fraction is "." 231 #define F loatingPointFMTDecl( T ) \237 #define FLOATING_POINT_FMT_DECL( T ) \ 232 238 static inline { \ 233 239 _Ostream_Manip(T) hex( T val ) { return (_Ostream_Manip(T))@{ val, 1, 0, 'a', { .all : 0 } }; } \ … … 256 262 } // ?|? 257 263 258 F loatingPointFMTDecl( double )259 F loatingPointFMTDecl( long double )264 FLOATING_POINT_FMT_DECL( double ) 265 FLOATING_POINT_FMT_DECL( long double ) 260 266 261 267 // *********************************** character *********************************** … … 297 303 // *********************************** istream *********************************** 298 304 305 306 #define ISTYPE_VOID( T ) void ?|?( istype &, T ) 307 #define ISTYPE_VOID_IMPL( T ) \ 308 void ?|?( istype & is, T & t ) { \ 309 (istype &)(is | t); ends( is ); \ 310 } // ?|? 299 311 300 312 forall( istype & ) … … 327 339 forall( istype & | basic_istream( istype ) ) { 328 340 istype & ?|?( istype &, bool & ); 329 void ?|?( istype &,bool & );341 ISTYPE_VOID( bool & ); 330 342 331 343 istype & ?|?( istype &, char & ); 332 void ?|?( istype &,char & );344 ISTYPE_VOID( char & ); 333 345 istype & ?|?( istype &, signed char & ); 334 void ?|?( istype &,signed char & );346 ISTYPE_VOID( signed char & ); 335 347 istype & ?|?( istype &, unsigned char & ); 336 void ?|?( istype &,unsigned char & );348 ISTYPE_VOID( unsigned char & ); 337 349 338 350 istype & ?|?( istype &, short int & ); 339 void ?|?( istype &,short int & );351 ISTYPE_VOID( short int & ); 340 352 istype & ?|?( istype &, unsigned short int & ); 341 void ?|?( istype &,unsigned short int & );353 ISTYPE_VOID( unsigned short int & ); 342 354 istype & ?|?( istype &, int & ); 343 void ?|?( istype &,int & );355 ISTYPE_VOID( int & ); 344 356 istype & ?|?( istype &, unsigned int & ); 345 void ?|?( istype &,unsigned int & );357 ISTYPE_VOID( unsigned int & ); 346 358 istype & ?|?( istype &, long int & ); 347 void ?|?( istype &,long int & );359 ISTYPE_VOID( long int & ); 348 360 istype & ?|?( istype &, unsigned long int & ); 349 void ?|?( istype &,unsigned long int & );361 ISTYPE_VOID( unsigned long int & ); 350 362 istype & ?|?( istype &, long long int & ); 351 void ?|?( istype &,long long int & );363 ISTYPE_VOID( long long int & ); 352 364 istype & ?|?( istype &, unsigned long long int & ); 353 void ?|?( istype &,unsigned long long int & );365 ISTYPE_VOID( unsigned long long int & ); 354 366 #if defined( __SIZEOF_INT128__ ) 355 367 istype & ?|?( istype &, int128 & ); 356 void ?|?( istype &,int128 & );368 ISTYPE_VOID( int128 & ); 357 369 istype & ?|?( istype &, unsigned int128 & ); 358 void ?|?( istype &,unsigned int128 & );370 ISTYPE_VOID( unsigned int128 & ); 359 371 #endif // __SIZEOF_INT128__ 360 372 361 373 istype & ?|?( istype &, float & ); 362 void ?|?( istype &,float & );374 ISTYPE_VOID( float & ); 363 375 istype & ?|?( istype &, double & ); 364 void ?|?( istype &,double & );376 ISTYPE_VOID( double & ); 365 377 istype & ?|?( istype &, long double & ); 366 void ?|?( istype &,long double & );378 ISTYPE_VOID( long double & ); 367 379 368 380 istype & ?|?( istype &, float _Complex & ); 369 void ?|?( istype &,float _Complex & );381 ISTYPE_VOID( float _Complex & ); 370 382 istype & ?|?( istype &, double _Complex & ); 371 void ?|?( istype &,double _Complex & );383 ISTYPE_VOID( double _Complex & ); 372 384 istype & ?|?( istype &, long double _Complex & ); 373 void ?|?( istype &,long double _Complex & );385 ISTYPE_VOID( long double _Complex & ); 374 386 375 387 // istype & ?|?( istype &, const char [] ); … … 379 391 // manipulators 380 392 istype & ?|?( istype &, istype & (*)( istype & ) ); 381 void ?|?( istype &,istype & (*)( istype & ) );393 ISTYPE_VOID( istype & (*)( istype & ) ); 382 394 istype & nl( istype & is ); 383 395 istype & nlOn( istype & ); … … 437 449 }; // _Istream_Manip 438 450 439 #define I nputFMTDecl( T ) \451 #define INPUT_FMT_DECL( T ) \ 440 452 static inline { \ 441 453 _Istream_Manip(T) ignore( const T & val ) { return (_Istream_Manip(T))@{ (T &)val, -1, true }; } \ … … 449 461 } // ?|? 450 462 451 I nputFMTDecl( signed char )452 I nputFMTDecl( unsigned char )453 I nputFMTDecl( signed short int )454 I nputFMTDecl( unsigned short int )455 I nputFMTDecl( signed int )456 I nputFMTDecl( unsigned int )457 I nputFMTDecl( signed long int )458 I nputFMTDecl( unsigned long int )459 I nputFMTDecl( signed long long int )460 I nputFMTDecl( unsigned long long int )461 462 I nputFMTDecl( float )463 I nputFMTDecl( double )464 I nputFMTDecl( long double )465 466 I nputFMTDecl( float _Complex )467 I nputFMTDecl( double _Complex )468 I nputFMTDecl( long double _Complex )463 INPUT_FMT_DECL( signed char ) 464 INPUT_FMT_DECL( unsigned char ) 465 INPUT_FMT_DECL( signed short int ) 466 INPUT_FMT_DECL( unsigned short int ) 467 INPUT_FMT_DECL( signed int ) 468 INPUT_FMT_DECL( unsigned int ) 469 INPUT_FMT_DECL( signed long int ) 470 INPUT_FMT_DECL( unsigned long int ) 471 INPUT_FMT_DECL( signed long long int ) 472 INPUT_FMT_DECL( unsigned long long int ) 473 474 INPUT_FMT_DECL( float ) 475 INPUT_FMT_DECL( double ) 476 INPUT_FMT_DECL( long double ) 477 478 INPUT_FMT_DECL( float _Complex ) 479 INPUT_FMT_DECL( double _Complex ) 480 INPUT_FMT_DECL( long double _Complex ) 469 481 470 482
Note: See TracChangeset
for help on using the changeset viewer.