Changeset baa1d5d for libcfa/src/iostream.cfa
- Timestamp:
- Jan 27, 2024, 11:29:57 PM (8 months ago)
- Branches:
- master
- Children:
- 63e129c
- Parents:
- 765ee42
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/iostream.cfa
r765ee42 rbaa1d5d 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jan 25 08:39:31202413 // Update Count : 190 112 // Last Modified On : Sat Jan 27 18:02:40 2024 13 // Update Count : 1909 14 14 // 15 15 … … 1002 1002 return is | *(_Istream_Cstr *)&f; 1003 1003 } // fini 1004 if ( ! flags.ignore && args == 0 ) s[0] = '\0'; // read failed => no pattern match => set string to null 1004 // read failed => no pattern match => set string to null 1005 if ( ! flags.ignore && s != 0p && args == 0 ) s[0] = '\0'; 1005 1006 if ( args == 1 && eof( is ) ) { // data but scan ended at EOF 1006 1007 clear( is ); // => reset EOF => detect again on next read … … 1055 1056 if ( flags.delimiter ) { // getline 1056 1057 int len = 0; // may not be set in fmt 1057 sprintf( &fmtstr[pos], "[^%c]%%n", delimiters[0] ); 1058 if ( delimiters[2] != '\0' ) { // read single character ? 1059 sprintf( &fmtstr[pos], "c%%n" ); 1060 } else { 1061 sprintf( &fmtstr[pos], "[^%c]%%n", delimiters[0] ); 1062 } // if 1058 1063 if ( flags.ignore ) args = fmt( is, fmtstr, &len ); // no string argument for '*' 1059 1064 else args = fmt( is, fmtstr, s, &len ); … … 1097 1102 } // ?|? 1098 1103 1099 istype & ?|?( istype & is, _Istream_Char f ) with(f) {1100 if ( ignore ) {1101 fmt( is, "%*c" ); // argument variable unused1102 } else {1103 int len = -1, args = fmt( is, fmt, &c, &len );1104 if ( args != -1 && len == -1 ) throwResume ExceptionInst( missing_data );1105 } // if1106 return is;1107 } // ?|?1104 // istype & ?|?( istype & is, _Istream_Char f ) with(f) { 1105 // if ( ignore ) { 1106 // fmt( is, "%*c" ); // argument variable unused 1107 // } else { 1108 // int len = -1, args = fmt( is, fmt, &c, &len ); 1109 // if ( args != -1 && len == -1 ) throwResume ExceptionInst( missing_data ); 1110 // } // if 1111 // return is; 1112 // } // ?|? 1108 1113 } // distribution 1109 1114 … … 1124 1129 } // distribution 1125 1130 1131 INPUT_FMT_IMPL( char, "c" ) 1126 1132 INPUT_FMT_IMPL( signed char, "hhi" ) 1127 1133 INPUT_FMT_IMPL( unsigned char, "hhi" )
Note: See TracChangeset
for help on using the changeset viewer.