Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

XMLMetadataLoader Class Reference

MetadataLoader that loads metadata information from a XML file written by XMLMetadataWriter. More...

#include <XMLMetadataLoader.h>

Inheritance diagram for XMLMetadataLoader:

Inheritance graph
[legend]
Collaboration diagram for XMLMetadataLoader:

Collaboration graph
[legend]
List of all members.

Public Member Functions

int loadMetadata (const char *location, ClassHierarchy *classes, CStdString &warningsForUser, CStdString &errorForUser)

Protected Member Functions

CStdString getInputFileName (const char *location)
int processClassElement (DOMElement *rootElement, ClassHierarchy *classes, CStdString &warningsForUser, CStdString &errorForUser)
int processMappingElement (DOMElement *rootElement, FullClassInfo &classInfo, CStdString &warningsForUser, CStdString &errorForUser)
int processGroupElement (DOMElement *rootElement, FullClassInfo &classInfo, CStdString &warningsForUser, CStdString &errorForUser)
int processHintsElement (DOMElement *rootElement, FullClassInfo &classInfo, CStdString &warningsForUser, CStdString &errorForUser)
int fillInAttributeInfo (DOMElement *rootElement, CStdString &attrName, AttributeInfo &attrInfo, CStdString &warningsForUser, CStdString &errorForUser, const CStdString &className, bool persistent)

Detailed Description

MetadataLoader that loads metadata information from a XML file written by XMLMetadataWriter.

See also:
MetadataLoader


Member Function Documentation

int XMLMetadataLoader::loadMetadata const char *  location,
ClassHierarchy classes,
CStdString &  warningsForUser,
CStdString &  errorForUser
[virtual]
 

Loads metadata from given XML file.

Parameters:
location Name of the XML file (including path) or directory where the file can be found (in this case file name is created using m_projectName and DEFAULT_METADATA_FILENAME).
classes Container into which the metadata should be loaded.
warningsForUser String used to send warning message(s) to user if needed.
errorForUser String used to send an error message to user if needed.
Returns:
0 if OK, non-zero in case of error.

Implements MetadataLoader.

CStdString XMLMetadataLoader::getInputFileName const char *  location  )  [protected]
 

Generates input file name using location. See description of location parameter in loadMetadata().

Returns:
Name of the file if OK, empty string in case of error.

int XMLMetadataLoader::processClassElement DOMElement *  rootElement,
ClassHierarchy classes,
CStdString &  warningsForUser,
CStdString &  errorForUser
[protected]
 

Processes <class> element of parsed XML tree, adds acquired info to classes.

Parameters:
rootElement The <class> element.
classes Container into which the class information should be added.
warningsForUser String used to send warning message(s) to user if needed.
errorForUser String used to send an error message to user if needed.
Returns:
0 if OK, non-zero in case of error.

int XMLMetadataLoader::processMappingElement DOMElement *  rootElement,
FullClassInfo classInfo,
CStdString &  warningsForUser,
CStdString &  errorForUser
[protected]
 

Processes <mapping> element of parsed XML tree, adds acquired info to classInfo.

Parameters:
rootElement The <mapping> element.
classInfo Object with metadata information for current class.
warningsForUser String used to send warning message(s) to user if needed.
errorForUser String used to send an error message to user if needed.
Returns:
0 if OK, non-zero in case of error.

int XMLMetadataLoader::processGroupElement DOMElement *  rootElement,
FullClassInfo classInfo,
CStdString &  warningsForUser,
CStdString &  errorForUser
[protected]
 

Processes <group> element of parsed XML tree, adds acquired info to classInfo.

Parameters:
rootElement The <group> element.
classInfo Object with metadata information for current class.
warningsForUser String used to send warning message(s) to user if needed.
errorForUser String used to send an error message to user if needed.
Returns:
0 if OK, non-zero in case of error.

int XMLMetadataLoader::processHintsElement DOMElement *  rootElement,
FullClassInfo classInfo,
CStdString &  warningsForUser,
CStdString &  errorForUser
[protected]
 

Processes <hints> element of parsed XML tree, adds acquired info to classInfo.

Parameters:
rootElement The <hints> element.
classInfo Object with metadata information for current class.
warningsForUser String used to send warning message(s) to user if needed.
errorForUser String used to send an error message to user if needed.
Returns:
0 if OK, non-zero in case of error.

int XMLMetadataLoader::fillInAttributeInfo DOMElement *  rootElement,
CStdString &  attrName,
AttributeInfo attrInfo,
CStdString &  warningsForUser,
CStdString &  errorForUser,
const CStdString &  className,
bool  persistent
[protected]
 

Processes <attribute> element of parsed XML tree, puts acquired info into AttributeInfo structure.

Parameters:
rootElement The <attribute> element.
attrName Result of this function - name of attribute represented by this element.
attrInfo AttributeInfo structure to be filled in.
warningsForUser String used to send warning message(s) to user if needed.
errorForUser String used to send an error message to user if needed.
className Name of class this attribute comes from. For logging purposes (in case of error) only.
persistent Flag that says whether the attribute is persistent or not.
Returns:
0 if OK, non-zero in case of error.


The documentation for this class was generated from the following files:
Generated on Wed Aug 11 22:36:50 2004 for IOPC by Doxygen 1.3.6