validator Class Reference

A class for validating tree data. More...

#include <validator.h>

Collaboration diagram for validator:
Collaboration graph
[legend]

List of all members.

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)
stringencodeidchain (void)
void makeerror (string &into, int errorcode, const string &errortext, const string &detail="")

Protected Attributes

value schema
statstring currentid
value idchain

Detailed Description

A class for validating tree data.


Constructor & Destructor Documentation

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  ) 

Constructor.

Loads a schema file.

Parameters:
fn The file path/name for the validation schema.

References load().

Here is the call graph for this function:


Member Function Documentation

bool validator::check ( const value data,
string error 
)

Check an object against the schema.

Parameters:
data The object to be checked.
errors Errors will be pushed into this array.
Returns:
true on success.

References value::clear(), and string::crop().

Referenced by configdb< appclass >::load().

Here is the call graph for this function:

bool validator::load ( const string fn  ) 

Load schema data.

Parameters:
fn The file path/nbame for the validation schema.

References value::count(), and value::loadxml().

Referenced by configdb< appclass >::load(), and validator().

Here is the call graph for this function:


The documentation for this class was generated from the following files:

Generated on Sun Feb 28 10:37:01 2010 for GRACE by  doxygen 1.6.1