Changes in libcfa/src/parseconfig.cfa [b5e725a:6a93e4d]
- File:
-
- 1 edited
-
libcfa/src/parseconfig.cfa (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/parseconfig.cfa
rb5e725a r6a93e4d 16 16 #pragma GCC visibility push(default) 17 17 18 19 18 // *********************************** exceptions *********************************** 20 19 20 21 // TODO: Add names of missing config entries to exception (see further below) 22 vtable(Missing_Config_Entries) Missing_Config_Entries_vt; 21 23 22 24 [ void ] ?{}( & Missing_Config_Entries this, unsigned int num_missing ) { … … 27 29 // TODO: use string interface when it's ready (and implement exception msg protocol) 28 30 [ void ] msg( * Missing_Config_Entries ex ) { 29 serr | "The config file is missing " | ex->num_missing | "entr" | nosep| (ex->num_missing == 1 ? "y." : "ies.");31 serr | "The config file is missing " | ex->num_missing | "entr" | sepOff | (ex->num_missing == 1 ? "y." : "ies."); 30 32 } // msg 31 33 34 35 vtable(Parse_Failure) Parse_Failure_vt; 32 36 33 37 [ void ] ?{}( & Parse_Failure this, [] char failed_key, [] char failed_value ) { … … 50 54 } 51 55 56 57 vtable(Validation_Failure) Validation_Failure_vt; 52 58 53 59 [ void ] ?{}( & Validation_Failure this, [] char failed_key, [] char failed_value ) { … … 106 112 107 113 108 static [ bool ] comments( & ifstream in, size_t size,[] char name ) {114 static [ bool ] comments( & ifstream in, [] char name ) { 109 115 while () { 110 in | wdi( size, name );116 in | name; 111 117 if ( eof( in ) ) return true; 112 118 if ( name[0] != '#' ) return false; … … 130 136 // NOTE: Must add check to see if already read in value for this key, 131 137 // once we switch to using hash table as intermediate storage 132 if ( comments( in, 64, key ) ) break;// eof ?133 in | wdi( 256, value );138 if ( comments( in, key ) ) break; // eof ? 139 in | value; 134 140 135 141 add_kv_pair( *kv_pairs, key, value );
Note:
See TracChangeset
for help on using the changeset viewer.