Changeset 69e06ff
- Timestamp:
- Nov 26, 2023, 9:42:26 AM (5 months ago)
- Branches:
- master
- Children:
- 2d373440, 39eb784
- Parents:
- 6a1f553
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/parseconfig.cfa
r6a1f553 r69e06ff 1 2 3 1 #pragma GCC diagnostic push 4 2 //#pragma GCC diagnostic ignored "-Wunused-parameter" … … 74 72 75 73 76 [ void ] ?{}( & KVPairs kvp ) with ( kvp ) { 74 [ void ] ?{}( & KVPairs kvp ) with ( kvp ) { // default constructor 77 75 size = 0; max_size = 0; data = 0p; 78 76 } 79 77 80 [ void ] ?{}( & KVPairs kvp, size_t size ) { 78 [ void ] ?{}( & KVPairs kvp, size_t size ) { // initialization 81 79 kvp.[ size, max_size ] = [ 0, size ]; 82 80 kvp.data = alloc( size ); 83 81 } 84 82 85 [ void ] ^?{}( & KVPairs kvp ) with ( kvp ) { 83 [ void ] ^?{}( & KVPairs kvp ) with ( kvp ) { // destructor 86 84 for ( i; size ) free( data[i] ); 87 85 free( data ); … … 111 109 if ( eof( in ) ) return true; 112 110 if ( name[0] != '#' ) return false; 113 in | nl; // ignore remainder of line111 in | nl; // ignore remainder of line 114 112 } // while 115 113 } // comments … … 122 120 ifstream in; 123 121 try { 124 open( in, config_file ); // open the configuration file for input122 open( in, config_file ); // open the configuration file for input 125 123 126 124 [64] char key; 127 125 [256] char value; 128 126 129 while () { // parameter names can appear in any order127 while () { // parameter names can appear in any order 130 128 // NOTE: Must add check to see if already read in value for this key, 131 129 // once we switch to using hash table as intermediate storage 132 if ( comments( in, 64, key ) ) break;// eof ?130 if ( comments( in, 64, key ) ) break; // eof ? 133 131 in | wdi( 256, value ); 134 132 … … 136 134 137 135 if ( eof( in ) ) break; 138 in | nl; // ignore remainder of line136 in | nl; // ignore remainder of line 139 137 } // for 140 138 } catch( open_failure * ex; ex->istream == &in ) {
Note: See TracChangeset
for help on using the changeset viewer.