PixelLightAPI  .
Public Member Functions
PLCore::XmlDeclaration Class Reference

XML declaration node. More...

#include <XmlDeclaration.h>

Inheritance diagram for PLCore::XmlDeclaration:
Inheritance graph
[legend]

List of all members.

Public Member Functions

PLCORE_API XmlDeclaration ()
 Default constructor.
PLCORE_API XmlDeclaration (const XmlDeclaration &cSource)
 Copy constructor.
PLCORE_API XmlDeclaration (const String &sVersion, const String &sEncoding, const String &sStandalone)
 Constructor.
virtual PLCORE_API ~XmlDeclaration ()
 Destructor.
PLCORE_API XmlDeclarationoperator= (const XmlDeclaration &cSource)
 Copy operator.
String GetVersion () const
 Version - will return an empty string if none was found.
String GetEncoding () const
 Encoding - will return an empty string if none was found.
String GetStandalone () const
 Standalone - will return an empty string if none was found.
virtual PLCORE_API bool Save (File &cFile, uint32 nDepth=0) override
 Save function.
virtual PLCORE_API String ToString (uint32 nDepth=0) const override
 Output as string function.
virtual PLCORE_API const char * Parse (const char *pszData, XmlParsingData *pData=nullptr, EEncoding nEncoding=EncodingUnknown) override
 Parse the given null terminated block of XML data.
virtual PLCORE_API XmlNodeClone () const override
 Create an exact duplicate of this node and return it.

Detailed Description

XML declaration node.

Remarks:
In correct XML the declaration is the first entry in the file.
*    <?xml version="1.0" standalone="yes"?>
*    

The parser 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.

Constructor & Destructor Documentation

Default constructor.

PLCORE_API PLCore::XmlDeclaration::XmlDeclaration ( const XmlDeclaration cSource)

Copy constructor.

Parameters:
[in]cSourceSource to copy from
PLCORE_API PLCore::XmlDeclaration::XmlDeclaration ( const String sVersion,
const String sEncoding,
const String sStandalone 
)

Constructor.

Parameters:
[in]sVersionVersion
[in]sEncodingEncoding
[in]sStandaloneStandalone
virtual PLCORE_API PLCore::XmlDeclaration::~XmlDeclaration ( ) [virtual]

Destructor.


Member Function Documentation

PLCORE_API XmlDeclaration& PLCore::XmlDeclaration::operator= ( const XmlDeclaration cSource)

Copy operator.

Parameters:
[in]cSourceSource to copy from
Returns:
Reference to this instance

Version - will return an empty string if none was found.

Returns:
Version - will return an empty string if none was found

Encoding - will return an empty string if none was found.

Returns:
Encoding - will return an empty string if none was found

Standalone - will return an empty string if none was found.

Returns:
Standalone - will return an empty string if none was found
virtual PLCORE_API bool PLCore::XmlDeclaration::Save ( File cFile,
uint32  nDepth = 0 
) [override, virtual]

Save function.

Parameters:
[out]cFileFile to write in, must be opened and writable
[in]nDepthCurrent depth
Returns:
'true' if all went fine, else 'false'

Implements PLCore::XmlBase.

virtual PLCORE_API String PLCore::XmlDeclaration::ToString ( uint32  nDepth = 0) const [override, virtual]

Output as string function.

Parameters:
[in]nDepthCurrent depth
Returns:
String containing the XML

Implements PLCore::XmlBase.

virtual PLCORE_API const char* PLCore::XmlDeclaration::Parse ( const char *  pszData,
XmlParsingData pData = nullptr,
EEncoding  nEncoding = EncodingUnknown 
) [override, virtual]

Parse the given null terminated block of XML data.

Parameters:
[in]pszDataParsing data, if a null pointer, an error will be returned
[in]pDataParsing data, can be a null pointer
[in]nEncodingEncoding
Returns:
The pointer to the parameter 'pszData' if all went fine, else a null pointer
Remarks:
Passing in an encoding to this method (either 'EncodingLegacy' or 'EncodingUTF8' will force the parser to use that encoding, regardless of what the parser might otherwise try to detect.

Implements PLCore::XmlBase.

virtual PLCORE_API XmlNode* PLCore::XmlDeclaration::Clone ( ) const [override, virtual]

Create an exact duplicate of this node and return it.

Returns:
The clone, a null pointer on error
Note:
  • The memory must be deleted by the caller

Implements PLCore::XmlNode.


The documentation for this class was generated from the following files:


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:29
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported