Changeset 6604ea1 for libcfa


Ignore:
Timestamp:
Aug 31, 2021, 1:49:09 AM (3 years ago)
Author:
Jacob Prud'homme <jafprudhomme@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, pthread-emulation, qualifiedEnum
Children:
930609e2
Parents:
80ae121
git-author:
Jacob Prud'homme <jafprudhomme@…> (07/16/21 15:35:50)
git-committer:
Jacob Prud'homme <jafprudhomme@…> (08/31/21 01:49:09)
Message:

Added optional validation step when parsing values

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/parseconfig.cfa

    r80ae121 r6604ea1  
    100100                        if ( entries[j].parse( src_value, entries[j].variable ) ) {
    101101                                ++entries_so_far;
     102
     103                                // Validate the parsed data, if necessary
     104                                if ( entries[j].validate != 0p ) {
     105                                        if ( !entries[j].validate( entries[j].variable ) ) throwValidation_Failure( entries[j] );
     106                                }
     107
    102108                                break;
    103109                        }
Note: See TracChangeset for help on using the changeset viewer.