PLCnext API Documentation 25.0.2.69
|
Class handle xml configuration documents More...
#include <XmlConfigDocument.hpp>
Public Member Functions | |
XmlConfigDocument (const String &documentXmlElementName, IXmlSerializable &content) | |
Constructs an XmlConfigDocument instance. More... | |
XmlConfigDocument (MultiXmlConfigDocument &rootDocument, IXmlSerializable &content) | |
Constructs an XmlConfigDocument instance. | |
virtual | ~XmlConfigDocument (void)=default |
Destructs this instance and frees all resouces. | |
const String & | GetPath (void) const |
Returns the path to the current file loaded by this document | |
IXmlSerializable & | GetContent (void) |
Returns the current content of this document | |
MultiXmlConfigDocument * | GetRootDocument (void) |
Returns a pointer to the root document for MultiXmlConfigDocument | |
Version | GetRecentVersion (void) const |
Returns the recent implemented schema version, used by XmlSerializationContext | |
const DocumentTraits & | GetTraits (void) const |
Returns current traits of document | |
void | Load (const String &documentPath) |
Loads the document from specified <paramref="documentPath"/> | |
void | Load (const String &documentPath, const DocumentTraits &documentTraits) |
Loads the document from specified <paramref="documentPath"/> and with given <paramref="documentTraits"/> | |
bool | TryLoad (const String &documentPath) |
Tries to load document from specified <paramref="documentPath"/> More... | |
bool | TryLoad (const String &documentPath, const DocumentTraits &documentTraits) |
Tries to load document from specified <paramref="documentPath"/> and with given <paramref="documentTraits"/> More... | |
void | Save (const String &documentPath) |
saves the content xml encoded to documentPath with filesystem sync | |
void | Save (const String &documentPath, bool syncFilesystem) |
saves the content xml encoded to documentPath More... | |
void | Save (const String &documentPath, bool syncFilesystem, const Version &schemaVersion) |
saves the content xml encoded to documentPath More... | |
void | Save (void) |
saves the content xml encoded to the file the document was loaded from with filesystem sync | |
void | Save (bool syncFilesystem) |
saves the content xml encoded to the file the document was loaded from More... | |
void | LoadString (const String &xmlContent, const String &contentTraits=String::Empty) |
Loads the document from a string | |
Protected Member Functions | |
virtual void | ReadDocument (XmlReader &reader) |
Protected Attributes | |
MultiXmlConfigDocument * | pRootDoc |
IXmlSerializable & | content |
String | documentXmlElementName |
String | path |
DocumentTraits | traits |
Version | recentVersion |
Friends | |
class | XmlSerializationContext |
Class handle xml configuration documents
Arp::System::Commons::Xml::XmlConfigDocument::XmlConfigDocument | ( | const String & | documentXmlElementNameArg, |
IXmlSerializable & | contentArg | ||
) |
Constructs an XmlConfigDocument instance.
documentXmlElementName | name of the root element of the document |
content | class which implements IXmlSerializable and can parse documentXmlElementName |
|
protectedvirtual |
Reimplemented in Arp::System::Commons::Xml::MultiXmlConfigDocument.
void Arp::System::Commons::Xml::XmlConfigDocument::Save | ( | bool | syncFilesystem | ) |
saves the content xml encoded to the file the document was loaded from
syncFilesystem | true: synchronize filesystem |
void Arp::System::Commons::Xml::XmlConfigDocument::Save | ( | const String & | documentPath, |
bool | syncFilesystem | ||
) |
saves the content xml encoded to documentPath
syncFilesystem | true: synchronize filesystem |
void Arp::System::Commons::Xml::XmlConfigDocument::Save | ( | const String & | documentPath, |
bool | syncFilesystem, | ||
const Version & | schemaVersion | ||
) |
saves the content xml encoded to documentPath
syncFilesystem | true: synchronize filesystem |
schemaVersion | version of the XML schema as attribute schemaVersion at the document element, omitted if equal to Version() |
bool Arp::System::Commons::Xml::XmlConfigDocument::TryLoad | ( | const String & | documentPath | ) |
Tries to load document from specified <paramref="documentPath"/>
true
if the document was loaded successfully, otherwise false
.bool Arp::System::Commons::Xml::XmlConfigDocument::TryLoad | ( | const String & | documentPath, |
const DocumentTraits & | documentTraits | ||
) |
Tries to load document from specified <paramref="documentPath"/> and with given <paramref="documentTraits"/>
true
if the document was loaded successfully, otherwise false
.