Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
XMLLoadSave Class Reference#include <XMLLoadSave.h>
Inheritance diagram for XMLLoadSave:
![]() Detailed DescriptionXMLLoadSave adds functions for XML format serialization, although if you write binary LoadSave functions as well, you can do either.Definition at line 20 of file XMLLoadSave.h.
Constructor & Destructor Documentation
Member Function Documentation
assignment operator
Definition at line 39 of file XMLLoadSave.cc. Referenced by TimerEvent::operator=(), SegmentedColorFilterBankEvent::operator=(), plist::PolymorphicLoader::operator=(), PitchEvent::operator=(), LookoutScanEvent::operator=(), FilterBankEvent::operator=(), and DataEvent< T, TID >::operator=().
This is called when the subclass needs to update its values from those values in the parse tree. node is the current node in the tree -- it may be the root, but it may also be a subnode within the tree if a recursive structure is used Implemented in EventBase, LocomotionEvent, LookoutPointAtEvent, LookoutIREvent, PitchEvent, TextMsgEvent, TimerEvent, VisionObjectEvent, InstanceTracker< FamilyT, ClassNameT, FactoryBaseT, FactoryT >, plist::PolymorphicLoader, plist::ObjectBase, plist::ObjectBase, plist::DictionaryBase, plist::ArrayBase, plist::Primitive< T >, plist::Primitive< char >, plist::Primitive< unsigned char >, plist::Primitive< std::string >, plist::NamedEnumeration< T >, plist::Primitive< float >, plist::Primitive< int >, plist::Primitive< unsigned int >, plist::Primitive< bool >, plist::NamedEnumeration< J_DCT_METHOD >, plist::NamedEnumeration< Config::vision_config::shutter_speeds >, plist::NamedEnumeration< Config::main_config::consoleMode_t >, plist::NamedEnumeration< Config::sound_config::volume_levels >, plist::NamedEnumeration< Config::vision_config::white_balance_levels >, plist::NamedEnumeration< Config::transports >, plist::NamedEnumeration< Config::vision_config::RawCamConfig::encoding_t >, plist::NamedEnumeration< Config::vision_config::RawCamConfig::compression_t >, plist::NamedEnumeration< Config::vision_config::SegCamConfig::compression_t >, and plist::NamedEnumeration< Config::vision_config::gain_levels >. Referenced by loadBuffer(), loadFile(), loadFileStream(), and readParseTree().
This is called when XMLLoadSave needs to have the subclass update values in the tree currently in memory -- may already be filled out by previous contents. node is the current node in the tree -- it may be the root, but it may also be a subnode within the tree if a recursive structure is used Implemented in EventBase, LocomotionEvent, LookoutPointAtEvent, LookoutIREvent, PitchEvent, TextMsgEvent, TimerEvent, VisionObjectEvent, plist::PolymorphicLoader, plist::ObjectBase, plist::DictionaryBase, plist::ArrayBase, plist::Primitive< T >, plist::Primitive< char >, plist::Primitive< unsigned char >, plist::Primitive< std::string >, plist::NamedEnumeration< T >, plist::Primitive< float >, plist::Primitive< int >, plist::Primitive< unsigned int >, plist::Primitive< bool >, plist::NamedEnumeration< J_DCT_METHOD >, plist::NamedEnumeration< Config::vision_config::shutter_speeds >, plist::NamedEnumeration< Config::main_config::consoleMode_t >, plist::NamedEnumeration< Config::sound_config::volume_levels >, plist::NamedEnumeration< Config::vision_config::white_balance_levels >, plist::NamedEnumeration< Config::transports >, plist::NamedEnumeration< Config::vision_config::RawCamConfig::encoding_t >, plist::NamedEnumeration< Config::vision_config::RawCamConfig::compression_t >, plist::NamedEnumeration< Config::vision_config::SegCamConfig::compression_t >, and plist::NamedEnumeration< Config::vision_config::gain_levels >. Referenced by getBinSize(), saveBuffer(), saveFile(), saveFileStream(), and writeParseTree().
Calculates space needed to save - if you can't precisely add up the size, just make sure to overestimate and things will still work. getBinSize is used for reserving buffers during serialization, but does not necessarily determine the actual size of what is written -- the return value of saveBuffer() specifies that after the data actually has been written. If getBinSize overestimates, the extra memory allocation is only temporary, no extra filler bytes are actually stored.
Implements LoadSave. Reimplemented in EventBase, LocomotionEvent, LookoutPointAtEvent, LookoutIREvent, PitchEvent, TextMsgEvent, TimerEvent, and VisionObjectEvent. Definition at line 64 of file XMLLoadSave.cc. Referenced by EventBase::getBinSize().
Load from a saved buffer in memory.
Implements LoadSave. Reimplemented in EventBase, and Config. Definition at line 82 of file XMLLoadSave.cc. Referenced by plist::loadBuffer(), EventBase::loadBuffer(), and Config::loadBuffer().
Save to a given buffer in memory.
Implements LoadSave. Reimplemented in EventBase. Definition at line 124 of file XMLLoadSave.cc. Referenced by EventBase::saveBuffer().
initiate opening of the specified file and loading/saving of all appropriate information.
Reimplemented from LoadSave. Reimplemented in EventBase, and Config. Definition at line 148 of file XMLLoadSave.cc. Referenced by plist::loadFile(), EventBase::loadFile(), Config::loadFile(), and ConfigurationEditor::LoadSettings::selectedFile().
initiate opening of the specified file and loading/saving of all appropriate information.
Reimplemented from LoadSave. Reimplemented in EventBase. Definition at line 193 of file XMLLoadSave.cc. Referenced by EventBase::saveFile(), and ConfigurationEditor::SaveSettings::selectedFile().
Used recursively on member objects once a file is already open - DON'T CLOSE the file in your overridden functions.
Reimplemented from LoadSave. Reimplemented in EventBase, and Config. Definition at line 214 of file XMLLoadSave.cc. Referenced by EventBase::loadFileStream(), and Config::loadFileStream().
Used recursively on member objects once a file is already open - DON'T CLOSE the file in your overridden functions.
Reimplemented from LoadSave. Reimplemented in EventBase. Definition at line 248 of file XMLLoadSave.cc. Referenced by EventBase::saveFileStream().
resets the parse tree currently in memory so that a future save will write a "fresh" copy from scratch. You may also want to call this in order to save memory after a Load so that the parse tree information isn't retained in memory if you don't care about retaining the file formatting Definition at line 266 of file XMLLoadSave.cc. Referenced by operator=(), and ~XMLLoadSave().
assigns a parse tree which you have obtained from some other source This doesn't update the contents of the subclass's values. The values in doc will be overwritten by those in the subclass on the next Save. If you wish to have the subclass's values updated from doc, call readParseTree() after calling this. Reimplemented in plist::ObjectBase. Definition at line 270 of file XMLLoadSave.cc. Referenced by getBinSize(), operator=(), saveBuffer(), saveFile(), saveFileStream(), plist::ObjectBase::setParseTree(), and writeParseTree().
returns the current parse tree, either from a previous Load, Save, or setParseTree()
Definition at line 80 of file XMLLoadSave.h.
calls loadXML with the root of the current parse tree
Definition at line 276 of file XMLLoadSave.cc.
calls saveXML with the root of the current parse tree
Definition at line 288 of file XMLLoadSave.cc.
allows you to set the compression level used by libxml2 -- this corresponds to the compression level setting of zlib, i.e. 0-9
Definition at line 301 of file XMLLoadSave.cc.
returns the current compression level setting used by libxml2 (via zlib)
Definition at line 90 of file XMLLoadSave.h. returns the root element of the xml document
Reimplemented in plist::ObjectBase. Definition at line 307 of file XMLLoadSave.cc. Referenced by plist::ObjectBase::FindRootXMLElement(), getBinSize(), loadBuffer(), loadFile(), loadFileStream(), readParseTree(), saveBuffer(), saveFile(), saveFileStream(), plist::ObjectBase::setParseTree(), and writeParseTree().
cleans up after an error occurs and sends a message to cerr
Definition at line 54 of file XMLLoadSave.cc. Referenced by getBinSize(), loadBuffer(), loadFile(), loadFileStream(), readParseTree(), saveBuffer(), saveFile(), saveFileStream(), and writeParseTree().
called by libxml2 when it's ready for more data to be read from the source (in this case, a file)
Definition at line 319 of file XMLLoadSave.cc. Referenced by loadFileStream().
called by libxml2 when it's done reading data
Definition at line 322 of file XMLLoadSave.cc. Referenced by loadFileStream(). returns the next element following cur You should call this with node->next, otherwise you'll just keep getting the same node back again Definition at line 326 of file XMLLoadSave.cc. Referenced by VisionObjectEvent::loadXML(), TimerEvent::loadXML(), TextMsgEvent::loadXML(), plist::ArrayBase::loadXML(), plist::DictionaryBase::loadXML(), PitchEvent::loadXML(), LookoutIREvent::loadXML(), LookoutPointAtEvent::loadXML(), LocomotionEvent::loadXML(), plist::DictionaryBase::saveOverXMLNode(), VisionObjectEvent::saveXML(), TimerEvent::saveXML(), TextMsgEvent::saveXML(), plist::ArrayBase::saveXML(), plist::DictionaryBase::saveXML(), PitchEvent::saveXML(), LookoutIREvent::saveXML(), LookoutPointAtEvent::saveXML(), and LocomotionEvent::saveXML(). returns the next element following cur; comment is set to the concatination of any comments is encountered in the interim You should call this with node->next, otherwise you'll just keep getting the same node back again Definition at line 332 of file XMLLoadSave.cc.
Member Data Documentation
the cached xml parse tree -- contains additional formatting information such as white space and comments
Definition at line 114 of file XMLLoadSave.h. Referenced by clearParseTree(), getBinSize(), getParseTree(), loadBuffer(), loadFile(), loadFileStream(), operator=(), readParseTree(), saveBuffer(), saveFile(), saveFileStream(), setCompression(), setParseTree(), plist::ObjectBase::setParseTree(), and writeParseTree().
the current compression level, or level to be used for the next save
Definition at line 117 of file XMLLoadSave.h. Referenced by getBinSize(), getCompression(), operator=(), saveBuffer(), saveFile(), saveFileStream(), setCompression(), and writeParseTree().
if true, the saved document will use automatic indenting and formatting
Definition at line 120 of file XMLLoadSave.h. Referenced by plist::Collection::Collection(), getBinSize(), operator=(), saveBuffer(), saveFile(), and saveFileStream().
allows tracking of libxml usage so the library can be initialized and destructed automatically
The documentation for this class was generated from the following files: |
Tekkotsu v4.0 |
Generated Thu Nov 22 00:58:50 2007 by Doxygen 1.5.4 |