#include <tinyxml.h>
In correct XML the declaration is the first entry in the file.
<?xml version="1.0" standalone="yes"?>
TinyXml will happily read or write files without a declaration, however. There are 3 possible attributes to the declaration: version, encoding, and standalone.
Note: In this version of the code, the attributes are handled as special cases, not generic attributes, simply because there can only be at most 3 and they are always the same.
TiXmlDeclaration::TiXmlDeclaration | ( | ) | [inline] |
TiXmlDeclaration::TiXmlDeclaration | ( | const char * | _version, | |
const char * | _encoding, | |||
const char * | _standalone | |||
) |
Construct.
References encoding, standalone, and version.
TiXmlDeclaration::TiXmlDeclaration | ( | const TiXmlDeclaration & | copy | ) |
virtual TiXmlDeclaration::~TiXmlDeclaration | ( | ) | [inline, virtual] |
void TiXmlDeclaration::operator= | ( | const TiXmlDeclaration & | copy | ) |
const char* TiXmlDeclaration::Version | ( | ) | const [inline] |
Version. Will return an empty string if none was found.
References TiXmlString::c_str(), and version.
const char* TiXmlDeclaration::Encoding | ( | ) | const [inline] |
Encoding. Will return an empty string if none was found.
References TiXmlString::c_str(), and encoding.
Referenced by TiXmlDocument::Parse().
const char* TiXmlDeclaration::Standalone | ( | ) | const [inline] |
Is this a standalone document?
References TiXmlString::c_str(), and standalone.
TiXmlNode * TiXmlDeclaration::Clone | ( | ) | const [virtual] |
Creates a copy of this Declaration and returns it.
Implements TiXmlNode.
References CopyTo(), and TiXmlDeclaration().
void TiXmlDeclaration::Print | ( | FILE * | cfile, | |
int | depth | |||
) | const [virtual] |
Print this declaration to a FILE stream.
Implements TiXmlBase.
References TiXmlString::c_str(), TiXmlString::empty(), encoding, standalone, and version.
const char * TiXmlDeclaration::Parse | ( | const char * | p, | |
TiXmlParsingData * | data, | |||
TiXmlEncoding | encoding | |||
) | [virtual] |
Implements TiXmlBase.
References TiXmlParsingData::Cursor(), encoding, TiXmlNode::GetDocument(), TiXmlBase::IsWhiteSpace(), TiXmlBase::location, TiXmlAttribute::Parse(), TiXmlDocument::SetError(), TiXmlBase::SkipWhiteSpace(), TiXmlParsingData::Stamp(), standalone, TiXmlBase::StringEqual(), TiXmlBase::TIXML_ERROR_PARSING_DECLARATION, TiXmlAttribute::Value(), and version.
void TiXmlDeclaration::CopyTo | ( | TiXmlDeclaration * | target | ) | const [protected] |
References encoding, standalone, and version.
Referenced by Clone(), operator=(), and TiXmlDeclaration().
void TiXmlDeclaration::StreamOut | ( | TiXmlOutStream * | out | ) | const [protected, virtual] |
Implements TiXmlBase.
References TiXmlString::empty(), encoding, TiXmlBase::PutString(), standalone, and version.
TiXmlString TiXmlDeclaration::version [private] |
Referenced by CopyTo(), Parse(), Print(), StreamOut(), TiXmlDeclaration(), and Version().
TiXmlString TiXmlDeclaration::encoding [private] |
Referenced by CopyTo(), Encoding(), Parse(), Print(), StreamOut(), and TiXmlDeclaration().
TiXmlString TiXmlDeclaration::standalone [private] |
Referenced by CopyTo(), Parse(), Print(), Standalone(), StreamOut(), and TiXmlDeclaration().