A class for validating tree data. More...
#include <validator.h>

Public Member Functions | |
| validator (void) | |
| validator (const string &fn) | |
| bool | load (const string &fn) |
| bool | check (const value &data, string &error) |
Protected Member Functions | |
| bool | checkobject (const value &obj, const statstring &id, string &error) |
| bool | matchObject (const value &, const value &, string &) |
| bool | matchMandatory (const value &, const value &, string &) |
| bool | matchData (const value &, const value &, string &) |
| bool | matchChild (const value &, const value &, string &) |
| bool | matchAttrib (const value &, const value &, string &) |
| bool | matchHasIndex (const value &, const value &, string &) |
| bool | matchType (const value &, const value &, string &) |
| bool | matchClass (const value &, const value &, string &) |
| bool | matchOr (const value &, const value &, string &) |
| bool | matchAnd (const value &, const value &, string &) |
| bool | matchId (const value &, const value &, string &) |
| bool | matchDataText (const value &, const string &) |
| bool | matchDataRegexp (const value &, const string &) |
| bool | matchDataLessThan (const value &, int) |
| bool | matchDataGreaterThan (const value &, int) |
| bool | matchDataMinSize (const value &, int) |
| bool | matchDataMaxSize (const value &, int) |
| string * | encodeidchain (void) |
| void | makeerror (string &into, int errorcode, const string &errortext, const string &detail="") |
Protected Attributes | |
| value | schema |
| statstring | currentid |
| value | idchain |
A class for validating tree data.
| validator::validator | ( | void | ) |
Constructor.
Use this constructor if you want to do a post- creation load of the validation schema file.
| validator::validator | ( | const string & | fn | ) |
Check an object against the schema.
| data | The object to be checked. | |
| errors | Errors will be pushed into this array. |
References value::clear(), and string::crop().
Referenced by configdb< appclass >::load().

| bool validator::load | ( | const string & | fn | ) |
Load schema data.
| fn | The file path/nbame for the validation schema. |
References value::count(), and value::loadxml().
Referenced by configdb< appclass >::load(), and validator().

1.6.1