Base class for writing XML formatted data to an output stream. More...
#include <utils.h>
Public Types | |
typedef unsigned short | content_type |
Public Member Functions | |
void | BeginObject (const Keyword &t, const Keyword &attr1, unsigned long val1, const Keyword &attr2, const string &val2) |
void | BeginObject (const Keyword &t, const Keyword &attr1, const long val1) |
void | BeginObject (const Keyword &t, const string &atts) |
void | BeginObject (const Keyword &t, const Keyword &attr1, const string &val1, const Keyword &attr2, const string &val2, const Keyword &attr3, const string &val3) |
void | BeginObject (const Keyword &t, const Keyword &attr1, const string &val1, const Keyword &attr2, const string &val2) |
void | BeginObject (const Keyword &t, const Keyword &attr1, const string &val1) |
void | BeginObject (const Keyword &t) |
unsigned long | countObjects () const |
void | EndObject (const Keyword &t) |
content_type | getContentType () const |
Object * | getCurrentObject () const |
string | getHeaderAtts () const |
string | getHeaderStart () const |
Object * | getPreviousObject () const |
void | setContentType (content_type c) |
void | setHeaderAtts (const string &s) |
void | setHeaderStart (const string &s) |
void | writeElement (const Keyword &t, const Object &o, mode m=DEFAULT) |
void | writeElement (const Keyword &, const Object *, mode=DEFAULT) |
void | writeElement (const Keyword &t, const DateRange &d) |
void | writeElement (const Keyword &t, const Date d) |
void | writeElement (const Keyword &t, const TimePeriod d) |
void | writeElement (const Keyword &t, const char *val) |
void | writeElement (const Keyword &u, const Keyword &t1, unsigned long val1, const Keyword &t2, const string &val2) |
void | writeElement (const Keyword &u, const Keyword &t1, const string &val1, const Keyword &t2, const string &val2) |
void | writeElement (const Keyword &u, const Keyword &t, const Date &val) |
void | writeElement (const Keyword &u, const Keyword &t, const long val) |
void | writeElement (const Keyword &u, const Keyword &t, const string &val) |
void | writeElement (const Keyword &t, const string &val) |
void | writeElement (const Keyword &t, const bool val) |
void | writeElement (const Keyword &t, const double val) |
void | writeElement (const Keyword &t, const int val) |
void | writeElement (const Keyword &t, const long unsigned int val) |
void | writeElementWithHeader (const Keyword &tag, const Object *object) |
void | writeHeader (const Keyword &tag) |
void | writeString (const string &c) |
XMLOutput () | |
XMLOutput (ostream &os) | |
Static Public Attributes | |
static const content_type | PLAN = 2 |
static const content_type | PLANDETAIL = 4 |
static const content_type | STANDARD = 1 |
Protected Member Functions | |
void | setOutput (ostream &o) |
Base class for writing XML formatted data to an output stream.
Subclasses implement writing to specific stream types, such as files and strings.
Definition at line 2135 of file utils.h.
typedef unsigned short frepple::utils::XMLOutput::content_type |
This type is used to define different types of output.
frepple::utils::XMLOutput::XMLOutput | ( | ostream & | os | ) | [inline] |
frepple::utils::XMLOutput::XMLOutput | ( | ) | [inline] |
void frepple::utils::XMLOutput::BeginObject | ( | const Keyword & | t, | |
const string & | atts | |||
) | [inline] |
void frepple::utils::XMLOutput::BeginObject | ( | const Keyword & | t | ) | [inline] |
unsigned long frepple::utils::XMLOutput::countObjects | ( | ) | const [inline] |
void frepple::utils::XMLOutput::EndObject | ( | const Keyword & | t | ) | [inline] |
content_type frepple::utils::XMLOutput::getContentType | ( | ) | const [inline] |
Returns which type of export is requested. Constants have been defined for each type.
Object* frepple::utils::XMLOutput::getCurrentObject | ( | ) | const [inline] |
string frepple::utils::XMLOutput::getHeaderAtts | ( | ) | const [inline] |
string frepple::utils::XMLOutput::getHeaderStart | ( | ) | const [inline] |
Object* frepple::utils::XMLOutput::getPreviousObject | ( | ) | const [inline] |
void frepple::utils::XMLOutput::setContentType | ( | content_type | c | ) | [inline] |
Specify the type of export.
void frepple::utils::XMLOutput::setHeaderAtts | ( | const string & | s | ) | [inline] |
void frepple::utils::XMLOutput::setHeaderStart | ( | const string & | s | ) | [inline] |
void frepple::utils::XMLOutput::setOutput | ( | ostream & | o | ) | [inline, protected] |
void frepple::utils::XMLOutput::writeElement | ( | const Keyword & | t, | |
const Object & | o, | |||
mode | m = DEFAULT | |||
) | [inline] |
void frepple::utils::XMLOutput::writeElement | ( | const Keyword & | tag, | |
const Object * | object, | |||
mode | m = DEFAULT | |||
) |
This method writes a serializable object. It maintains a STL-map of all objects that have been saved already. For objects that have already been saved earlier, the method will instruct the serializable object to write only a reference, rather than the complete object. You should call this method for all objects in your xml document, except for the root object.
Definition at line 578 of file xmlparser.cpp.
void frepple::utils::XMLOutput::writeElement | ( | const Keyword & | t, | |
const TimePeriod | d | |||
) | [inline] |
void frepple::utils::XMLOutput::writeElement | ( | const Keyword & | t, | |
const char * | val | |||
) | [inline] |
void frepple::utils::XMLOutput::writeElement | ( | const Keyword & | t, | |
const string & | val | |||
) | [inline] |
void frepple::utils::XMLOutput::writeElement | ( | const Keyword & | t, | |
const bool | val | |||
) | [inline] |
void frepple::utils::XMLOutput::writeElement | ( | const Keyword & | t, | |
const double | val | |||
) | [inline] |
void frepple::utils::XMLOutput::writeElement | ( | const Keyword & | t, | |
const int | val | |||
) | [inline] |
void frepple::utils::XMLOutput::writeElement | ( | const Keyword & | t, | |
const long unsigned int | val | |||
) | [inline] |
void frepple::utils::XMLOutput::writeElementWithHeader | ( | const Keyword & | tag, | |
const Object * | object | |||
) |
This method writes a serializable object with a complete XML compliant header.
You should call this method for the root object of your xml document, and writeElement for all objects nested in it.
RuntimeException | Generated when multiple root elements are available for the output document. |
Definition at line 606 of file xmlparser.cpp.
void frepple::utils::XMLOutput::writeHeader | ( | const Keyword & | tag | ) |
This method writes the opening tag for an XML output.
You should call this method or writeElementWithHeader() when writing the first element of an xml document.
RuntimeException | Generated when multiple root elements are available for the output document. |
Definition at line 636 of file xmlparser.cpp.
void frepple::utils::XMLOutput::writeString | ( | const string & | c | ) | [inline] |
const XMLOutput::content_type frepple::utils::XMLOutput::PLAN = 2 [static] |
Constant to mark an export of the standard information plus the plan information. In this format, every entity is saved with the details on how it is used in the plan.
E.g. a resource will be saved with a reference to all its loadplans. E.g. an operation will be saved with all its operationplans.
const XMLOutput::content_type frepple::utils::XMLOutput::PLANDETAIL = 4 [static] |
const XMLOutput::content_type frepple::utils::XMLOutput::STANDARD = 1 [static] |
Constant used to mark standard export for the export. The standard export saves just enough information to persist the full state of the model as brief as possible.