Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/parseconfig.cfa

    rb5e725a r6a93e4d  
    1616#pragma GCC visibility push(default)
    1717
    18 
    1918// *********************************** exceptions ***********************************
    2019
     20
     21// TODO: Add names of missing config entries to exception (see further below)
     22vtable(Missing_Config_Entries) Missing_Config_Entries_vt;
    2123
    2224[ void ] ?{}( & Missing_Config_Entries this, unsigned int num_missing ) {
     
    2729// TODO: use string interface when it's ready (and implement exception msg protocol)
    2830[ 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.");
    3032} // msg
    3133
     34
     35vtable(Parse_Failure) Parse_Failure_vt;
    3236
    3337[ void ] ?{}( & Parse_Failure this, [] char failed_key, [] char failed_value ) {
     
    5054}
    5155
     56
     57vtable(Validation_Failure) Validation_Failure_vt;
    5258
    5359[ void ] ?{}( & Validation_Failure this, [] char failed_key, [] char failed_value ) {
     
    106112
    107113
    108 static [ bool ] comments( & ifstream in, size_t size, [] char name ) {
     114static [ bool ] comments( & ifstream in, [] char name ) {
    109115        while () {
    110                 in | wdi( size, name );
     116                in | name;
    111117          if ( eof( in ) ) return true;
    112118          if ( name[0] != '#' ) return false;
     
    130136                        // NOTE: Must add check to see if already read in value for this key,
    131137                        // 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;
    134140
    135141                        add_kv_pair( *kv_pairs, key, value );
Note: See TracChangeset for help on using the changeset viewer.