FreeCAD C++
|
#include <Base/Reader.h>
The XML reader class This is an important helper class for the store and retrieval system of objects in FreeCAD. These classes mainly inherit the App::Persitance base class and implement the Restore() method.
Public Member Functions | |
XMLReader (const char *FileName, std::istream &) | |
open the file and read the first element | |
void | setPartialRestore (bool on) |
sets simultaneously the global and local PartialRestore bits | |
bool | testStatus (ReaderStatus pos) const |
return the status bits | |
void | setStatus (ReaderStatus pos, bool on) |
set the status bits | |
Parser handling | |
const char * | localName (void) const |
get the local name of the current Element | |
void | readElement (const char *ElementName=0) |
read until a start element is found (<name>) or start-end element (<name/>) (with special name if given) | |
void | readEndElement (const char *ElementName=0) |
read until an end element is found (with special name if given) | |
void | readCharacters (void) |
read until characters are found | |
void | readBinFile (const char *) |
read binary file | |
Attribute handling | |
unsigned int | getAttributeCount (void) const |
get the number of attributes of the current element | |
bool | hasAttribute (const char *AttrName) const |
check if the read element has a special attribute | |
long | getAttributeAsInteger (const char *AttrName) const |
return the named attribute as an interer (does type checking) | |
unsigned long | getAttributeAsUnsigned (const char *AttrName) const |
double | getAttributeAsFloat (const char *AttrName) const |
return the named attribute as a double floating point (does type checking) | |
const char * | getAttribute (const char *AttrName) const |
return the named attribute as a double floating point (does type checking) | |
additional file reading | |
const char * | addFile (const char *Name, Base::Persistence *Object) |
add a read request of a persistent object | |
void | readFiles (zipios::ZipInputStream &zipstream) const |
process the requested file writes | |
const std::vector< std::string > & | getFilenames () const |
get all registered file names | |
bool | isRegistered (Base::Persistence *Object) const |
virtual void | addName (const char *, const char *) |
virtual const char * | getName (const char *) const |
virtual bool | doNameMapping () const |
Public Attributes | |
int | DocumentSchema |
Schema Version of the document. | |
std::string | ProgramVersion |
Version of FreeCAD that wrote this document. | |
int | FileVersion |
Version of the file format. | |
Protected Member Functions | |
bool | read (void) |
read the next element | |
Content handler | |
virtual void | startDocument () |
virtual void | endDocument () |
virtual void | startElement (const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname, const XERCES_CPP_NAMESPACE_QUALIFIER Attributes &attrs) |
virtual void | endElement (const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname) |
virtual void | characters (const XMLCh *const chars, const XMLSize_t length) |
virtual void | ignorableWhitespace (const XMLCh *const chars, const XMLSize_t length) |
Lexical handler | |
virtual void | startCDATA () |
virtual void | endCDATA () |
Document handler | |
virtual void | resetDocument () |
Error handler | |
void | warning (const XERCES_CPP_NAMESPACE_QUALIFIER SAXParseException &exc) |
void | error (const XERCES_CPP_NAMESPACE_QUALIFIER SAXParseException &exc) |
void | fatalError (const XERCES_CPP_NAMESPACE_QUALIFIER SAXParseException &exc) |
void | resetErrors () |