Changeset 8a9a3ab for libcfa/src/iostream.hfa
- Timestamp:
- Sep 1, 2023, 3:54:42 PM (2 years ago)
- Branches:
- master
- Children:
- 4b30318b
- Parents:
- 4269d1b (diff), 4c0fa03 (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
-
libcfa/src/iostream.hfa
r4269d1b r8a9a3ab 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Aug 25 14:55:06202313 // Update Count : 5 3512 // Last Modified On : Thu Aug 31 10:55:35 2023 13 // Update Count : 544 14 14 // 15 15 … … 406 406 // *********************************** manipulators *********************************** 407 407 408 struct _Istream_Cstr { 409 char * s; 408 struct _Istream_str_base { 410 409 union { 411 410 const char * scanset; … … 422 421 } flags; 423 422 }; 423 }; // _Istream_str_base 424 425 struct _Istream_Cstr { 426 char * s; 427 inline _Istream_str_base; 424 428 }; // _Istream_Cstr 425 429 426 430 static inline { 427 431 // width must include room for null terminator 428 _Istream_Cstr wdi( unsigned int wd, char s[] ) { return (_Istream_Cstr)@{ s, { 0p}, wd, {.all : 0} }; }432 _Istream_Cstr wdi( unsigned int wd, char s[] ) { return (_Istream_Cstr)@{ s, { {0p}, wd, {.all : 0} } }; } 429 433 // read width does not include null terminator 430 434 _Istream_Cstr wdi( unsigned int wd, unsigned int rwd, char s[] ) { 431 435 if ( wd <= rwd ) throw (cstring_length){ &cstring_length_vt }; 432 return (_Istream_Cstr)@{ s, { 0p}, rwd, {.flags.rwd : true} };436 return (_Istream_Cstr)@{ s, { {0p}, rwd, {.flags.rwd : true} } }; 433 437 } 434 _Istream_Cstr skip( const char scanset[] ) { return (_Istream_Cstr)@{ 0p, { scanset}, -1, {.all : 0} }; }435 _Istream_Cstr skip( unsigned int wd ) { return (_Istream_Cstr)@{ 0p, { 0p}, wd, {.all : 0} }; }438 _Istream_Cstr skip( const char scanset[] ) { return (_Istream_Cstr)@{ 0p, { {scanset}, -1, {.all : 0} } }; } 439 _Istream_Cstr skip( unsigned int wd ) { return (_Istream_Cstr)@{ 0p, { {0p}, wd, {.all : 0} } }; } 436 440 _Istream_Cstr & getline( _Istream_Cstr & fmt, const char delimit = '\n' ) { 437 441 fmt.delimit[0] = delimit; fmt.delimit[1] = '\0'; fmt.flags.delimit = true; fmt.flags.inex = true; return fmt; } 438 442 _Istream_Cstr & incl( const char scanset[], _Istream_Cstr & fmt ) { fmt.scanset = scanset; fmt.flags.inex = false; return fmt; } 439 443 _Istream_Cstr & excl( const char scanset[], _Istream_Cstr & fmt ) { fmt.scanset = scanset; fmt.flags.inex = true; return fmt; } 440 _Istream_Cstr ignore( char s[] ) { return (_Istream_Cstr)@{ s, { 0p}, -1, {.flags.ignore : true} }; }444 _Istream_Cstr ignore( char s[] ) { return (_Istream_Cstr)@{ s, { {0p}, -1, {.flags.ignore : true} } }; } 441 445 _Istream_Cstr & ignore( _Istream_Cstr & fmt ) { fmt.flags.ignore = true; return fmt; } 442 446 } // distribution
Note:
See TracChangeset
for help on using the changeset viewer.