PLCnext API Documentation 23.6.0.37
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Arp::System::Commons::Xml::XmlConfigDocument Class Reference

Class handle xml configuration documents More...

#include <XmlConfigDocument.hpp>

Inheritance diagram for Arp::System::Commons::Xml::XmlConfigDocument:
Inheritance graph

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 StringGetPath (void) const
 Returns the path to the current file loaded by this document More...
 
IXmlSerializableGetContent (void)
 summary>Returns a pointer to the root document for MultiXmlConfigDocument
 
MultiXmlConfigDocumentGetRootDocument (void)
 summary>Returns the recend implemented schema version, used by XmlSerializationContext
 
Version GetRecentVersion (void) const
 
void Load (const String &documentPath)
 Loads the document from specified <paramref="documentPath"/> More...
 
bool TryLoad (const String &documentPath)
 summary>saves the content xml encoded to documentPath with filesystem sync
 
void Save (const String &documentPath)
 
void Save (const String &documentPath, bool syncFilesystem)
 
void Save (const String &documentPath, bool syncFilesystem, const Version &schemaVersion)
 summary>saves the content xml encoded to the file the document was loaded from with filesystem sync
 
void Save (void)
 
void Save (bool syncFilesystem)
 summary>Loads the document from a string
 
void LoadString (const String &xmlContent)
 

Protected Member Functions

virtual void ReadDocument (XmlReader &reader)
 

Protected Attributes

MultiXmlConfigDocumentpRootDoc
 
IXmlSerializablecontent
 
String documentXmlElementName
 
String path
 
Version recentVersion
 

Friends

class XmlSerializationContext
 

Detailed Description

Class handle xml configuration documents

Constructor & Destructor Documentation

◆ XmlConfigDocument()

Arp::System::Commons::Xml::XmlConfigDocument::XmlConfigDocument ( const String documentXmlElementName,
IXmlSerializable content 
)

Constructs an XmlConfigDocument instance.

param name="documentXmlElementName">name of the root element of the document

param name="content">class which implements IXmlSerializable and can parse documentXmlElementName

Member Function Documentation

◆ GetPath()

const String & Arp::System::Commons::Xml::XmlConfigDocument::GetPath ( void  ) const
inline

Returns the path to the current file loaded by this document

summary>Returns the current content of this document

◆ Load()

void Arp::System::Commons::Xml::XmlConfigDocument::Load ( const String documentPath)

Loads the document from specified <paramref="documentPath"/>

summary>Tries to load document from specified <paramref="documentPath"/>

returns>true if the document was loaded successfully, otherwise false.

◆ Save() [1/3]

void Arp::System::Commons::Xml::XmlConfigDocument::Save ( const String documentPath)

summary>saves the content xml encoded to documentPath

param name="syncFilesystem">true: synchronize filesystem

◆ Save() [2/3]

void Arp::System::Commons::Xml::XmlConfigDocument::Save ( const String documentPath,
bool  syncFilesystem 
)

summary>saves the content xml encoded to documentPath

param name="syncFilesystem">true: synchronize filesystem

param name="schemaVersion">version of the XML schema as attribute schemaVersion at the document element, omitted if equal to Version()

◆ Save() [3/3]

void Arp::System::Commons::Xml::XmlConfigDocument::Save ( void  )
inline

summary>saves the content xml encoded to the file the document was loaded from

param name="syncFilesystem">true: synchronize filesystem


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