xmlschema Class Reference

A parsed xmlschema file. More...

#include <xmlschema.h>

Collaboration diagram for xmlschema:
Collaboration graph
[legend]

List of all members.

Public Types

enum  extspec { forbid = false, allow = true }

Public Member Functions

 xmlschema (const string &name)
 xmlschema (hardCodedSchema i)
 xmlschema (void)
void load (const string &name)
void xmlrootschema (void)
void xmlbaseschema (void)
void netdbschema (void)
void runoptschema (void)
void validatorschema (void)
void plistschema (void)
void addbasemembers (value &)
void addbaseclass (const statstring &bt, const char *it, const char *cd, const char *icd)
bool hasnamespaces (void)
bool hasrootclass (void)
bool tagkey (void)
const stringgetrootclass (void)
bool hasdoctype (void)
const valuedoctype (void)
void nstranstype (value &ns, statstring &typ)
void nstransattr (value &nm, statstring &at, const value &v)
bool knownclass (const string &)
const stringresolveid (const string &cl, const string &scl)
bool wouldneedprecedents (const statstring &)
const stringresolvetype (const statstring &cl)
const stringresolvetypeattrib (const statstring &cl, const statstring &an)
const statstringresolveindexname (const statstring &)
void resolveclass (const statstring &, const statstring &, const statstring &, const statstring &, statstring &)
const statstringresolveidexport (const statstring &, const statstring &, const statstring &, const statstring &)
bool stringclassisbase64 (const statstring &)
bool iswrapcontainer (const statstring &)
bool iswrap (const statstring &)
bool iscontainerclass (const statstring &)
bool isunion (const statstring &)
const statstringresolveunion (const value *, const statstring &)
void resolveunionbase (statstring &)
bool containerhasattributes (const statstring &)
bool containerhasattribute (const statstring &, const statstring &)
bool hasvalueattribute (const statstring &)
const stringresolvevalueattribute (const statstring &)
bool isimplicitarray (const statstring &)
const stringresolvecontainerenvelope (const statstring &)
const stringresolvecontainerwrapclass (const statstring &)
const stringresolvecontaineridclass (const statstring &)
const stringresolvecontainervalueclass (const statstring &)
stringresolvecontainerboolclass (const statstring &, bool)
stringresolvecontainertypeclass (const statstring &, unsigned char)
stringresolvecontainerarrayclass (const statstring &)
stringresolvecontainerdictclass (const statstring &)
bool isinternaltype (const statstring &)
bool validate (const value &, const value &, extspec)
valuecreate (const statstring &)
valueinspectcode (const char *)
bool isattribute (const char *)
bool isindex (const char *)
bool isprecedent (const char *)
const stringxmltype (const char *)
const stringattributelabel (const char *)
const stringxmlclass (const char *)
bool isdict (const char *)
bool hasimplicit (const char *)
const stringimplicitid (const char *)
const stringprecedentclass (const char *)
const char * resolvecode (const statstring &)
const char * resolvecodeid (const statstring &)
const char * resolvecodeattrib (const statstring &, const statstring &)

Static Public Member Functions



static xmlschemaroot (void)
static xmlschemabase (void)
static xmlschemarunopt (void)
static xmlschemavalidator (void)
static xmlschemanetdb (void)
static xmlschemaplist (void)

Public Attributes

value schema

Protected Attributes

value codecache

Detailed Description

A parsed xmlschema file.

This class is used by the value class for XML exports and imports.


Constructor & Destructor Documentation

xmlschema::xmlschema ( const string name  ) 

Creator.

Loads disk schema file.

Parameters:
name path to schema file.

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

Here is the call graph for this function:

xmlschema::xmlschema ( hardCodedSchema  i  ) 

Creator.

Initialize as a builtin schema.

References netdbschema(), plistschema(), runoptschema(), value::type(), validatorschema(), xmlbaseschema(), and xmlrootschema().

Here is the call graph for this function:


Member Function Documentation

void xmlschema::addbaseclass ( const statstring bt,
const char *  it,
const char *  cd,
const char *  icd 
)

Add a primitive type.

Parameters:
bt The registered type.
it The intrinsic type.
cd CXML code for the class.
icd CXML code for the index attribute.

References value::setattrib(), and value::type().

Referenced by xmlbaseschema().

Here is the call graph for this function:

bool xmlschema::containerhasattribute ( const statstring theclass,
const statstring theattrib 
)

Return true if the provided class has a specific attribute.

Referenced by value::printxml().

bool xmlschema::containerhasattributes ( const statstring theclass  ) 

Return true if the provided class has attributes.

References value::exists().

Referenced by value::fromxml(), and value::printxml().

Here is the call graph for this function:

value * xmlschema::create ( const statstring type  ) 

Create new value object with all mandatory schema elements filled in.

References value::attributes(), visitor< kind >::enter(), value::exists(), visitor< kind >::first(), value::label(), visitor< kind >::next(), visitor< kind >::obj(), and visitor< kind >::up().

Here is the call graph for this function:

const value & xmlschema::doctype ( void   ) 

Get the doctype information.

The string data of the value is the doctype string, with the attribute 'dtd' containing the URI for the doctype DTD, the attribute 'name' containing the short name for the doctype and the attribute 'status' indicating the doctype being either public or private.

Referenced by value::toxml().

const string & xmlschema::getrootclass ( void   ) 

Return the root class if defined in the xml.schema.options section.

References value::sval().

Referenced by value::printxml().

Here is the call graph for this function:

bool xmlschema::hasnamespaces ( void   ) 

Returns true if the schema has namespace definitions.

References value::exists().

Referenced by value::fromxml().

Here is the call graph for this function:

bool xmlschema::hasrootclass ( void   ) 

Returns true if a root class is defined in the xml.schema.options section.

References value::exists().

Referenced by value::printxml().

Here is the call graph for this function:

bool xmlschema::hasvalueattribute ( const statstring theclass  ) 

If true, the class has an attribvalue attribute, indicating that the class data should be stored inside an attribute.

References value::exists().

Referenced by value::fromxml(), and value::printxml().

Here is the call graph for this function:

bool xmlschema::iscontainerclass ( const statstring theclass  ) 

Returns true if a class uses the 'container' method for encoding.

The main difference with regular methods is that child nodes instead of attributes are used for implying an object's type or id.

References visitor< kind >::enter(), and visitor< kind >::obj().

Referenced by value::fromxml(), and value::printxml().

Here is the call graph for this function:

bool xmlschema::iswrap ( const statstring theclass  ) 

Returns true if the class is defined with a wrap="true" attribute, indicating that its contents should be wrapped into the parent (container) class.

References value::exists().

Referenced by value::fromxml().

Here is the call graph for this function:

bool xmlschema::iswrapcontainer ( const statstring theclass  ) 

Returns true if the class is a container with child objects having a wrap="true" attribute indicating this class should only do type wrapping and has no child nodes.

References value::exists().

Referenced by value::printxml().

Here is the call graph for this function:

bool xmlschema::knownclass ( const string name  ) 

Returns true of a registered type is defined by the schema.

References value::exists().

Referenced by value::fromxml(), and value::printcompressed().

Here is the call graph for this function:

void xmlschema::load ( const string name  ) 

Load a schema file.

Parameters:
name File name.

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

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

Here is the call graph for this function:

void xmlschema::nstransattr ( value nm,
statstring at,
const value v 
)

Perform namespace translation of an attribute label.

Parameters:
nm Namespace data.
at Attribute name. Will be changed.
v Reference to the value implicated.

References string::crop(), string::cutat(), value::exists(), visitor< kind >::first(), value::id, visitor< kind >::next(), visitor< kind >::obj(), string::strcat(), string::strchr(), string::strlen(), value::sval(), and statstring::sval().

Referenced by value::fromxml().

Here is the call graph for this function:

void xmlschema::nstranstype ( value ns,
statstring typ 
)

Perform namespace translation of a type.

Parameters:
ns Namespace data.
typ The type. Will be changed by this method.

References string::cutat(), value::exists(), statstring::str(), string::strchr(), value::strlen(), value::sval(), and statstring::sval().

Referenced by value::fromxml().

Here is the call graph for this function:

void xmlschema::resolveclass ( const statstring id,
const statstring currentclass,
const statstring superclass,
const statstring superid,
statstring into 
)

Determines implicit class.

Looks at the context of the currently resolved class, superclass, key and the parent's key to see if any of these imply that the node should be written with another registered type.

References visitor< kind >::enter(), value::exists(), visitor< kind >::first(), visitor< kind >::id(), visitor< kind >::next(), visitor< kind >::obj(), visitor< kind >::root(), statstring::str(), and value::strlen().

Referenced by value::printcompressed(), and value::printxml().

Here is the call graph for this function:

const string & xmlschema::resolveid ( const string cl,
const string scl 
)

Determines an implicit id.

Parameters:
cl The current class.
scl The super-class.

References visitor< kind >::enter(), visitor< kind >::obj(), and tagkey().

Referenced by value::fromxml().

Here is the call graph for this function:

const statstring & xmlschema::resolveidexport ( const statstring id,
const statstring currentclass,
const statstring superclass,
const statstring superid 
)

Resolve type to key.

If the schema implies that objects of a certain class have a defined index key, this method will return the value for that key.

References value::attributes(), visitor< kind >::enter(), value::exists(), visitor< kind >::first(), visitor< kind >::next(), visitor< kind >::obj(), and visitor< kind >::up().

Referenced by value::printcompressed(), and value::printxml().

Here is the call graph for this function:

const string & xmlschema::resolvetype ( const statstring cl  ) 

Resolve a class to its intrinsic type.

Parameters:
cl Class name.

References value::exists(), and statstring::sval().

Referenced by value::fromxml(), value::printcompressed(), and wouldneedprecedents().

Here is the call graph for this function:

const string & xmlschema::resolvetypeattrib ( const statstring cl,
const statstring an 
)

Resolve an attribute to its intrinsic type.

Parameters:
cl Class name.
an Attribute name.

References visitor< kind >::enter(), visitor< kind >::obj(), value::sval(), and statstring::sval().

Referenced by value::printcompressed().

Here is the call graph for this function:

const string & xmlschema::resolvevalueattribute ( const statstring theclass  ) 

Return the attribute name for a type that encodes its value as such.

Referenced by value::fromxml(), and value::printxml().

bool xmlschema::stringclassisbase64 ( const statstring theclass  ) 

Returns true if the schema defined a string object to use base64 encoding.

References visitor< kind >::enter(), and visitor< kind >::obj().

Referenced by value::fromxml(), and value::printxml().

Here is the call graph for this function:

bool xmlschema::tagkey ( void   ) 

Returns true if unknown tags should be treated as keys.

References value::exists().

Referenced by resolveid().

Here is the call graph for this function:

bool xmlschema::wouldneedprecedents ( const statstring forclass  ) 

Used by CXML.

Determines whether attribute data should preceed object data.

References resolvetype().

Referenced by value::printcompressed().

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:23 2010 for GRACE by  doxygen 1.6.1