PLCnext API Documentation 25.0.2.69
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
Arp::System::Commons::Xml::MultiXmlConfigDocument Class Reference

special version of XmlConfigDocument to include xml configuration data from other xml files inside a configuration file More...

#include <MultiXmlConfigDocument.hpp>

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

Public Types

using Base = XmlConfigDocument
 
using Files = std::deque< FileItem >
 
using IncludedFiles = std::list< String >
 
using Logger = Arp::System::Commons::Diagnostics::Logging::Logger<>
 

Public Member Functions

 MultiXmlConfigDocument (const String &documentXmlElementName, IXmlSerializable &content)
 Constructs an MultiXmlConfigDocument instance. More...
 
virtual ~MultiXmlConfigDocument (void)=default
 Destructs this instance and frees all resouces.
 
void AddFile (const String &filePath, const DocumentTraits &fileTraits)
 
void Load (const String &documentPath)
 summary>Loads the document from specified <paramref="documentPath"/>and with given <paramref="documentTraits"/>
 
void Load (const String &documentPath, const DocumentTraits &documentTraits)
 
void Load (const ConfigurationSettings &configSettings)
 
bool TryLoad (const String &documentPath)
 
bool TryLoad (const String &documentPath, const DocumentTraits &documentTraits)
 
bool TryLoad (const ConfigurationSettings &configSettings)
 
- Public Member Functions inherited from Arp::System::Commons::Xml::XmlConfigDocument
 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
 
IXmlSerializableGetContent (void)
 Returns the current content of this document
 
MultiXmlConfigDocumentGetRootDocument (void)
 Returns a pointer to the root document for MultiXmlConfigDocument
 
Version GetRecentVersion (void) const
 Returns the recent implemented schema version, used by XmlSerializationContext
 
const DocumentTraitsGetTraits (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

void ReadDocument (XmlReader &reader) override
 summary>Loads the document from specified <paramref="documentPath"/> More...
 
Files & GetFiles ()
 
IncludedFiles & GetIncludedFiles ()
 
virtual void ReadDocument (XmlReader &reader)
 

Additional Inherited Members

- Protected Attributes inherited from Arp::System::Commons::Xml::XmlConfigDocument
MultiXmlConfigDocumentpRootDoc
 
IXmlSerializablecontent
 
String documentXmlElementName
 
String path
 
DocumentTraits traits
 
Version recentVersion
 

Detailed Description

special version of XmlConfigDocument to include xml configuration data from other xml files inside a configuration file

files can be included by code> Includes> /Includes> /code>

Constructor & Destructor Documentation

◆ MultiXmlConfigDocument()

Arp::System::Commons::Xml::MultiXmlConfigDocument::MultiXmlConfigDocument ( const String documentXmlNameArg,
IXmlSerializable contentArg 
)

Constructs an MultiXmlConfigDocument 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

◆ Load() [1/2]

void Arp::System::Commons::Xml::MultiXmlConfigDocument::Load ( const ConfigurationSettings configSettings)

summary>Tries to load all documents from specified <paramref="configSettings"/>

returns>true if all documents could be loaded successfully, otherwise false.

◆ Load() [2/2]

void Arp::System::Commons::Xml::MultiXmlConfigDocument::Load ( const String documentPath,
const DocumentTraits documentTraits 
)

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

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

◆ ReadDocument()

void Arp::System::Commons::Xml::MultiXmlConfigDocument::ReadDocument ( XmlReader reader)
overrideprotectedvirtual

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

Reimplemented from Arp::System::Commons::Xml::XmlConfigDocument.

◆ TryLoad()

bool Arp::System::Commons::Xml::MultiXmlConfigDocument::TryLoad ( const String documentPath)

summary>Tries to load document from specified <paramref="documentPath"/> and with given <paramref="documentTraits"/>

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


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