gSAFE
1.3.8
|
#include <hfactory.h>
Inherits QObject, and QXmlDefaultHandler.
Signals | |
void | errorSignal (QString err) |
Public Member Functions | |
HFactory (QString rdata="") | |
~HFactory (void) | |
void | appendTemplateData (QString rdata) |
bool | characters (const QString &ch) |
void | clearTemplateData (void) |
bool | endDocument (void) |
bool | endElement (const QString &ns, const QString &ln, const QString &name) |
bool | error (const QXmlParseException &exception) |
QString | errorString (void) |
bool | fatalError (const QXmlParseException &exception) |
HList * | genHList (QString part, QString inRole="") |
HTable * | genHTable (QString part, QString inRole="") |
HTableBase * | genTable (QString part, int mode=TABLE) |
int | readFromFile (QFile *f) |
int | readFromFile (QString fn) |
QString | sqlCreateString (QString part) |
bool | startDocument (void) |
bool | startElement (const QString &ns, const QString &ln, const QString &name, const QXmlAttributes &atts) |
bool | warning (const QXmlParseException &exception) |
HFactory is a meta-data/meta-object generator class.
The gSAFE works with meta-data object which are in datalib. This base meta data objects are HTableBase and the two descendats HTable and HList.
You can build these meta-data objects by api functions, or you can use the HFactory to build this object from an XML data. In the XML data yu can describe almost all information about the meta-data groups, so the HFactory can build the necessary data objects from it.
The format of the XML data is described here: http://hyperprog.com/gsafe/doc/TEMPLATEDOC.txt
You can find the XML Schema (XSD) file here: http://hyperprog.com/gsafe/doc/gsafemetadata.xsd
You can define this meta data objects, with api functions of HTableBase like this:
You can use HFactory to generate this meta data object from XML file. The XML definition which describe the code above look like this:
After you create a HFactory object you have to fill with the XML data. ( appendTemplateData() function) Every time when you need a meta data object you can generate it with genHTable() and genHList()
Definition at line 105 of file hfactory.h.
HFactory::HFactory | ( | QString | rdata = "" | ) |
Creates a HFactory object
rdata | you can set an initially XML data in this parameter. |
Definition at line 30 of file hfactory.cpp.
HFactory::~HFactory | ( | void | ) |
Destructor
Definition at line 46 of file hfactory.cpp.
void HFactory::appendTemplateData | ( | QString | rdata | ) |
Append XML meta data to the current. This XML will be concatenated to the end of the current data
Definition at line 111 of file hfactory.cpp.
bool HFactory::characters | ( | const QString & | ch | ) |
XML parsing function. Do not use, it works automatically
Definition at line 647 of file hfactory.cpp.
void HFactory::clearTemplateData | ( | void | ) |
Clears the XML meta data
Definition at line 117 of file hfactory.cpp.
bool HFactory::endDocument | ( | void | ) |
XML parsing function. Do not use, it works automatically
Definition at line 226 of file hfactory.cpp.
bool HFactory::endElement | ( | const QString & | ns, |
const QString & | ln, | ||
const QString & | name | ||
) |
XML parsing function. Do not use, it works automatically
Definition at line 701 of file hfactory.cpp.
bool HFactory::error | ( | const QXmlParseException & | exception | ) |
XML parsing function. Do not use, it works automatically
Definition at line 140 of file hfactory.cpp.
QString HFactory::errorString | ( | void | ) |
XML parsing function. Do not use, it works automatically
Definition at line 122 of file hfactory.cpp.
bool HFactory::fatalError | ( | const QXmlParseException & | exception | ) |
XML parsing function. Do not use, it works automatically
Definition at line 153 of file hfactory.cpp.
HList * HFactory::genHList | ( | QString | part, |
QString | inRole = "" |
||
) |
Generate a HList meta-data object according to the current XML meta data. If you specify the second "role" parameter the list returned in the specified role.
part | the name of the XML meta data element which will descibe of the generated meta-data. |
role | the (optional) role which the list returned. |
Definition at line 73 of file hfactory.cpp.
HTable * HFactory::genHTable | ( | QString | part, |
QString | inRole = "" |
||
) |
Generate a HTable meta-data object according to the current XML meta data. If you specify the second "role" parameter the table returned in the specified role.
part | the name of the XML meta data element which will descibe of the generated meta-data. |
role | the (optional) role which the table returned. |
Definition at line 64 of file hfactory.cpp.
HTableBase * HFactory::genTable | ( | QString | part, |
int | mode = TABLE |
||
) |
Generate a HTableBase meta-data object according to the current XML meta data.
part | the name of the XML meta data element which will describe of the generated meta-data. |
mode | Can be TABLE or LIST. The function generate HTable or HList |
Definition at line 166 of file hfactory.cpp.
int HFactory::readFromFile | ( | QFile * | f | ) |
Reads the XML meta data from a file.
f | the file to read |
Definition at line 94 of file hfactory.cpp.
int HFactory::readFromFile | ( | QString | fn | ) |
Reads the XML meta data from a file. Because the name is passed to QFile the name can be a valid file or a qt resource name too.
f | the file or resource to read |
Definition at line 105 of file hfactory.cpp.
QString HFactory::sqlCreateString | ( | QString | part | ) |
Returns the sql create string of the part.
Definition at line 82 of file hfactory.cpp.
bool HFactory::startDocument | ( | void | ) |
XML parsing function. Do not use, it works automatically
Definition at line 220 of file hfactory.cpp.
bool HFactory::startElement | ( | const QString & | ns, |
const QString & | ln, | ||
const QString & | name, | ||
const QXmlAttributes & | atts | ||
) |
XML parsing function. Do not use, it works automatically
Definition at line 232 of file hfactory.cpp.
bool HFactory::warning | ( | const QXmlParseException & | exception | ) |
XML parsing function. Do not use, it works automatically
Definition at line 127 of file hfactory.cpp.