Public Member Functions | |
Externalizer (Externalizable::ExternalizationType type, ref< VFile > archive) | |
Externalizer (Externalizable::ExternalizationType type, std::ios &stream) | |
virtual | ~Externalizer () |
virtual String | className () const |
bool | isOutput () const |
true is this is an output serialization stream | |
bool | isInput () const |
true if this is an input serialization stream | |
Externalizable::ExternalizationType | ioType () |
PathName | getArchivePath () const |
void | flush () |
flush output stream (no-op on input). Should use this before closing an output file before Externalizer goes out-of-scope. | |
bool | moreInput () |
String | readLine () |
read until end of line | |
String | readString (SInt maxLength=-1) |
read maxLength chars (or until end of context if -1) | |
void | writeLine (const String &line) |
write 'line' followed by end-of-line char | |
void | writeString (const String &str) |
write String str (may contain end-of-line chars) | |
void | writeComment (const String &comment) |
output a comment ('# ' in raw mode, xml comment in XML mode) | |
dom::DOMDocument * | doc () |
dom::DOMNode * | context () |
void | setDocumentType (const String &name, const String &publicid, const String &sysid) |
dom::DOMElement * | createElement (const String &tagname, bool indenting=true) |
void | pushContext (dom::DOMNode *context) |
dom::DOMNode * | popContext () |
void | appendElement (dom::DOMElement *e) |
void | appendBreak () |
dom::DOMElement * | lastAppendedElement () |
String | elementTagName (dom::DOMNode *n) |
void | appendElement (dom::DOMNode *n, const String &tagname, bool indenting=true) |
void | setElementAttribute (dom::DOMElement *e, const String &attrname, const String &value) |
void | appendProcessingInstruction (dom::DOMNode *n, const String &target, const String &data) |
dom::DOMText * | createText (const String &text) |
void | appendText (dom::DOMNode *n, const String &text) |
dom::DOMComment * | createComment (const String &comment) |
void | appendComment (dom::DOMNode *n, const String &comment) |
dom::DOMCDATASection * | createCDATA (const String &text) |
void | appendCDATA (dom::DOMNode *n, const String &text) |
void | appendNode (dom::DOMNode *n, dom::DOMNode *n2) |
void | appendBreak (dom::DOMNode *n) |
dom::DOMElement * | getFirstElement (dom::DOMNode *n, const String &tagname, bool required=true) |
dom::DOMElement * | getFirstChildElement (dom::DOMNode *n, const String &tagname, bool required=true) |
dom::DOMElement * | getNextSiblingElement (dom::DOMNode *n, const String &tagname, bool required=true) |
void | removeElement (dom::DOMElement *e) |
String | getContainedText (dom::DOMNode *n, bool removeIndentation=false) |
String | getElementAttribute (dom::DOMElement *e, const String &attrname, bool required=true) |
String | getDefaultedElementAttribute (dom::DOMElement *e, const String &attrname, const String &defaultValue) |
virtual bool | isSameKindAs (const Object &) const |
Static Public Member Functions | |
String | readLineFromStream (std::istream &istream) |
array< String > | splitIntoLines (const String &text, bool removeBlankLines=true) |
array< String > | splitAtDelimiter (const String &line, char delimiter=',') |
base::Vector | stringsToReals (const array< String > &strings, bool acceptUnits=true) |
base::Matrix4 | toMatrix4 (const String &text) |
String | toString (const base::Matrix4 &m) |
base::Vector3 | toVector3 (const String &text, bool acceptUnits=true) |
base::Vector | toVector (const String &text, bool commasep=false, bool acceptUnits=true) |
String | toString (const base::Vector3 &v) |
String | toString (const base::Vector &v, bool commasep=false) |
String | toString (const base::Matrix &m) |
String | toString (Real v, const String &units="m") |
Real | toReal (const String &text, bool acceptUnits=true) |
base::Matrix | toMatrix (const String &text) |
String | removeChar (const String &text, char toRemove) |
bool | isNumeric (const String &text) |
Static Public Attributes | |
const String | newline |
const Int | indentSpaces = 2 |
Protected Member Functions | |
Externalizer (const Externalizer &e) | |
std::istream & | input () |
std::ostream & | output () |
void | initXMLDoc (const String &rootElementName="") |
dom::DOMDocument * | xmlParseDocument () |
void | xmlWriteDocument (dom::DOMDocument *doc) |
void | xmlReleaseDocument () |
void | xmlFormat (dom::DOMNode *n, Int indent) |
bool | isNewline (dom::DOMNode *n) |
bool | equals (const XCh *str1, const String &str2) |
bool | isElement (dom::DOMNode *n) |
bool | isElement (dom::DOMNode *n, const String &tagname) |
void | abort (const String &exceptionString) |
Static Protected Member Functions | |
void | xmlInitialize () |
Protected Attributes | |
bool | xmlMode |
dom::DOMBuilder * | parser |
dom::DOMImplementation * | impl |
dom::DOMDocumentType * | doctype |
dom::DOMDocument * | xmldoc |
std::stack< dom::DOMNode * > | xmlcontext |
dom::DOMElement * | lastAppendedElem |
bool | isoutput |
bool | aborted |
std::istream * | istream |
std::ostream * | ostream |
PathName | path |
Static Protected Attributes | |
bool | xmlInitialized |
const String | inputToConstErrorString |
const String | inputDuringOutputErrorString |
|
|
|
|
|
|
|
Definition at line 202 of file Externalizer. References aborted, doctype, impl, isoutput, parser, xmlcontext, xmldoc, and xmlMode. |
|
|
|
Definition at line 167 of file Externalizer. References appendText(), Assert, newline, and xmlMode. |
|
Definition at line 153 of file Externalizer. References appendText(), Assert, newline, xmlcontext, and xmlMode. |
|
|
|
|
|
|
|
Definition at line 152 of file Externalizer. References Assert, lastAppendedElem, xmlcontext, and xmlMode. |
|
Definition at line 166 of file Externalizer. |
|
|
|
Referenced by appendBreak(). |
|
return the name of the object's class type. Must be defined by derived classes. Implements base::Object. Definition at line 105 of file Externalizer. References base::String. |
|
Definition at line 138 of file Externalizer. References initXMLDoc(), xmlcontext, and xmlMode. |
|
|
|
|
|
|
|
|
|
Definition at line 137 of file Externalizer. References initXMLDoc(), xmldoc, and xmlMode. |
|
Definition at line 155 of file Externalizer. References Assert, isElement(), base::String, and xmlMode. |
|
|
|
flush output stream (no-op on input). Should use this before closing an output file before Externalizer goes out-of-scope.
|
|
return the filesystem path of the stream to which this Externalizer is attached; or the empty String (if unknown - i.e. instantiated from an iostream) Definition at line 113 of file Externalizer. References path. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 209 of file Externalizer. References Assert, isInput(), and istream. Referenced by moreInput(). |
|
Definition at line 109 of file Externalizer. References isOutput(). |
|
|
|
Definition at line 234 of file Externalizer. Referenced by elementTagName(). |
|
true if this is an input serialization stream
Definition at line 108 of file Externalizer. References isOutput(). Referenced by input(), and moreInput(). |
|
|
|
|
|
true is this is an output serialization stream
Definition at line 107 of file Externalizer. References isoutput. |
|
|
|
Definition at line 154 of file Externalizer. References Assert, lastAppendedElem, and xmlMode. |
|
Definition at line 117 of file Externalizer. |
|
Definition at line 210 of file Externalizer. References Assert, isOutput(), and ostream. |
|
Definition at line 150 of file Externalizer. References Assert, xmlcontext, and xmlMode. |
|
Definition at line 149 of file Externalizer. References Assert, xmlcontext, and xmlMode. |
|
read until end of line
|
|
Definition at line 126 of file Externalizer. References base::String. |
|
read maxLength chars (or until end of context if -1)
|
|
|
|
|
|
if a DOCTYPE is to be set, always call setDocumentType() first on a new output Externalizer. Subsequent calls will be ignored. Only then can createElement() be called to create an element. createElement() must be the first 'write' method called on a new output Externalizer - in which case the element will be the root element of the document. |
|
Definition at line 158 of file Externalizer. References base::String. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
output a comment ('# ' in raw mode, xml comment in XML mode)
|
|
write 'line' followed by end-of-line char
|
|
write String str (may contain end-of-line chars)
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 247 of file Externalizer. Referenced by Externalizer(). |
|
Definition at line 222 of file Externalizer. Referenced by Externalizer(). |
|
Definition at line 221 of file Externalizer. Referenced by Externalizer(). |
|
Definition at line 199 of file Externalizer. |
|
Definition at line 240 of file Externalizer. |
|
Definition at line 239 of file Externalizer. |
|
Definition at line 246 of file Externalizer. Referenced by Externalizer(), and isOutput(). |
|
Definition at line 249 of file Externalizer. Referenced by input(). |
|
Definition at line 225 of file Externalizer. Referenced by appendElement(), and lastAppendedElement(). |
|
Definition at line 198 of file Externalizer. Referenced by appendBreak(). |
|
Definition at line 250 of file Externalizer. Referenced by output(). |
|
Definition at line 220 of file Externalizer. Referenced by Externalizer(). |
|
Definition at line 251 of file Externalizer. Referenced by getArchivePath(). |
|
Definition at line 224 of file Externalizer. Referenced by appendBreak(), appendElement(), context(), Externalizer(), popContext(), and pushContext(). |
|
Definition at line 223 of file Externalizer. Referenced by doc(), and Externalizer(). |
|
Definition at line 215 of file Externalizer. |
|
Definition at line 212 of file Externalizer. Referenced by appendBreak(), appendElement(), appendNode(), context(), doc(), elementTagName(), Externalizer(), lastAppendedElement(), popContext(), and pushContext(). |