Changeset 960665c for libcfa/src/parseconfig.cfa
- Timestamp:
- Aug 20, 2024, 6:15:01 PM (8 weeks ago)
- Branches:
- master
- Children:
- ad47ec4
- Parents:
- d1f5054 (diff), df2e00f (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/parseconfig.cfa
rd1f5054 r960665c 105 105 106 106 static [ bool ] comments( & ifstream in, size_t size, [] char name ) { 107 while () { 108 in | wdi( size, name ); 109 if ( eof( in ) ) return true; 110 if ( name[0] != '#' ) return false; 111 in | nl; // ignore remainder of line 112 } // while 107 bool comment = false; 108 try { 109 while () { 110 in | wdi( size, name ); 111 if ( name[0] != '#' ) break; 112 in | nl; // ignore remainder of line 113 } // while 114 } catch( end_of_file * ) { 115 comment = true; 116 } // try 117 return comment; 113 118 } // comments 114 119 … … 125 130 [256] char value; 126 131 127 while () { // parameter names can appear in any order 128 // NOTE: Must add check to see if already read in value for this key, 129 // once we switch to using hash table as intermediate storage 130 if ( comments( in, 64, key ) ) break; // eof ? 131 in | wdi( 256, value ); 132 133 add_kv_pair( *kv_pairs, key, value ); 134 135 if ( eof( in ) ) break; 136 in | nl; // ignore remainder of line 137 } // for 132 try { 133 while () { // parameter names can appear in any order 134 // NOTE: Must add check to see if already read in value for this key, 135 // once we switch to using hash table as intermediate storage 136 if ( comments( in, 64, key ) ) break; // eof ? 137 in | wdi( 256, value ); 138 139 add_kv_pair( *kv_pairs, key, value ); 140 141 in | nl; // ignore remainder of line 142 } // while 143 } catch( end_of_file * ) { 144 } // try 138 145 } catch( open_failure * ex; ex->istream == &in ) { 139 146 delete( kv_pairs );
Note: See TracChangeset
for help on using the changeset viewer.