#include <XMLMetadataWriter.h>
Inheritance diagram for XMLMetadataWriter:
Public Member Functions | |
virtual void | initialize (const char *projectName, const char *locationCommonPart, IopcMappingType defaultMappingType, const void *implSpecificParam) |
virtual int | addClass (const char *className, const BaseClassesList &baseClasses, const ClassAttributeList &classAttributes, const char *sourceFileName, CStdString &tmpDataLocation, const char *hint, CStdString &warningsForUser, CStdString &errorForUser) |
virtual int | saveMetadata (const std::list< CStdString > &tmpDataLocations, const char *metadataLocation, CStdString &warningsForUser, CStdString &errorForUser) |
Protected Member Functions | |
void | generateTmpFileName (const char *cppFileName, CStdString &tmpFileName) |
int | loadTmpFiles (const std::list< CStdString > &tmpDataLocations, MWClassHierarchy *classes, CStdString &warningsForUser, CStdString &errorForUser) |
int | loadTmpFilesFromDirectory (const char *directory, MWClassHierarchy *classes, CStdString &warningsForUser, CStdString &errorForUser) |
int | loadTmpFile (const char *tmpFileName, MWClassHierarchy *classes, CStdString &warningsForUser, CStdString &errorForUser) |
int | writeXMLFile (const MWClassHierarchy &classes, const char *outputFileName, CStdString &warningsForUser, CStdString &errorForUser) |
DOMNode * | createClassNode (const FullClassInfo *classInfo, DOMDocument *doc, CStdString &warningsForUser, CStdString &errorForUser) |
Static Protected Member Functions | |
int | getLine (std::ifstream &input, CStdString &line) |
void | parseCommaSeparatedList (const char *csl, std::vector< CStdString > &values) |
Protected Attributes | |
CStdString | m_dtdFilePath |
After parsing a declaration of C++ class in IOPC SP addClass() method is called. This method saves given data in some temporal format in file <source_name>.iopc . Method saveMetadata() puts together information from the temporary files, check whether the data are consistent and write it as XML mapping file.
|
Remembers all given parameters for future use.
This functions copies only
Reimplemented from MetadataWriter. |
|
Remembers class information in temporary file. Name of temporary file is generated by generateTmpFileName(). If no classes have been added to the file by this instance of XMLMetadataWriter yet, old content of file is rewritten. Temporary file consist of one or more class information. Information about one class has this format (indentation and ending commas are reguired):
Implements MetadataWriter. |
|
Puts together ("links") information from XMLMetadataWriter's temporary files, checks whether they are consistent, generates DB related information (table names, column names etc.) and writes all the data into XML file in format described by mapping.dtd. Methods of class MWClassHierarchy are used to generate the DB related information and to check consistence of data (this includes test whether we have descriptions of all persistent parents of each persistent class, whether there aren't two different definitions of the same class etc.)
If
Implements MetadataWriter. |
|
Generates name of XMLMetadataWriter's temporary file.
The filename is created using METADATA_WRITER_TMP_FILE_NAME and
|
|
Loads XMLMetadataWriter's temporary files. Acquired data are added to Precise description which files will be loaded can be found in saveMetadata().
|
|
Loads all XMLMetadataWriter's temporary files in given Uses METADATA_WRITER_TMP_FILE_NAME to recognize XMLMetadataWriter's temporary files.
|
|
Adds data from XMLMetadataWriter's temporary file Structure of the file is described in addClass(). Uses classes' FullClassInfo::otherInfo to store name of the file, in which the class have been seen for the first time. This is needed to provide user detailed error description if two different classes with the same name are found.
|
|
Writes information from
|
|
Creates XML subtree for given
|
|
Reads line from Helper function used by loadTmpFile().
|
|
Parses comma separated string Helper function used by loadTmpFile().
|
|
Path (without filename) where DTD file for XML mapping files can be found. Set by initialize(). |