PLCnext API Documentation  20.6.0.30321
Public Member Functions | Static Public Attributes | List of all members
Arp::System::Commons::Xml::XmlSerializationContext Class Reference

XML context used during XML reading and writing to hold the context information More...

#include <XmlSerializationContext.hpp>

Public Member Functions

 XmlSerializationContext (XmlConfigDocument &document, Version docSchemaVersion=Version(1, 0))
 Constructs an XmlContext instance. More...
 
 XmlSerializationContext (XmlSerializationContext &arg)=default
 Copy contructor. More...
 
XmlSerializationContextoperator= (XmlSerializationContext &arg)=default
 Assignment operator. More...
 
 ~XmlSerializationContext (void)=default
 Destructs this instance and frees all resouces. More...
 
Stringoperator[] (const String &attributeName)
 operator [] to get and set attributes referenced by attributeName More...
 
const Stringoperator[] (const String &attributeName) const
 
Version GetDocumentSchemaVersion (void) const
 returns the document schema version stored in this context More...
 
XmlConfigDocumentGetDocument (void)
 
void ReadDocumentContext (XmlReader &reader)
 reads the document context i.e. schema version from the XMlReader More...
 
void WriteDocumentContext (XmlWriter &writer) const
 
void InvalidXmlElementOccurs (XmlReader &reader, const char *xmlElementName)
 
void MissingXmlElementOccurs (XmlReader &reader, const char *xmlElementName)
 summary>Reads the include xml tags inside a configuration file to include further xml files More...
 
void ReadIncludesElement (XmlReader &reader)
 summary>resolves a relative path into an absolute relative to the document path More...
 
String ResolvePath (const char *documentPath)
 summary>resolves a string with a placeholder (Enviroment variables) More...
 
String ResolvePlaceholder (const char *input)
 summary>Adds a xml file to the list of included files More...
 
void AddIncludeFile (const String &path)
 

Static Public Attributes

static const char * IncludeXmlName
 
static const char * IncludesXmlName
 

Detailed Description

XML context used during XML reading and writing to hold the context information

Constructor & Destructor Documentation

◆ XmlSerializationContext() [1/2]

Arp::System::Commons::Xml::XmlSerializationContext::XmlSerializationContext ( XmlConfigDocument document,
Version  docSchemaVersion = Version(1, 0) 
)

Constructs an XmlContext instance.

◆ XmlSerializationContext() [2/2]

Arp::System::Commons::Xml::XmlSerializationContext::XmlSerializationContext ( XmlSerializationContext arg)
default

Copy contructor.

◆ ~XmlSerializationContext()

Arp::System::Commons::Xml::XmlSerializationContext::~XmlSerializationContext ( void  )
default

Destructs this instance and frees all resouces.

Member Function Documentation

◆ GetDocumentSchemaVersion()

Version Arp::System::Commons::Xml::XmlSerializationContext::GetDocumentSchemaVersion ( void  ) const
inline

returns the document schema version stored in this context

The document schema version is read by ReadDocumentContext

Returns
the document schema version

summary>return the XmlConfigDocument this context was created for

◆ InvalidXmlElementOccurs()

void Arp::System::Commons::Xml::XmlSerializationContext::InvalidXmlElementOccurs ( XmlReader reader,
const char *  xmlElementName 
)

summary>this operation should be called while xml serialisation when ever an xml element is missing

exception cref="XmlException">Is thrown

◆ MissingXmlElementOccurs()

void Arp::System::Commons::Xml::XmlSerializationContext::MissingXmlElementOccurs ( XmlReader reader,
const char *  xmlElementName 
)

summary>Reads the include xml tags inside a configuration file to include further xml files

◆ operator=()

XmlSerializationContext& Arp::System::Commons::Xml::XmlSerializationContext::operator= ( XmlSerializationContext arg)
default

Assignment operator.

◆ operator[]()

String & Arp::System::Commons::Xml::XmlSerializationContext::operator[] ( const String attributeName)
inline

operator [] to get and set attributes referenced by attributeName

summary>operator [] to get attributes referenced by attributeName

◆ ReadDocumentContext()

void Arp::System::Commons::Xml::XmlSerializationContext::ReadDocumentContext ( XmlReader reader)

reads the document context i.e. schema version from the XMlReader

is used by XmlConfigDocument summary>writes the document context i.e. schema version with the XMlWriter

is used by XmlConfigDocument

◆ ReadIncludesElement()

void Arp::System::Commons::Xml::XmlSerializationContext::ReadIncludesElement ( XmlReader reader)

summary>resolves a relative path into an absolute relative to the document path

◆ ResolvePath()

String Arp::System::Commons::Xml::XmlSerializationContext::ResolvePath ( const char *  documentPath)

summary>resolves a string with a placeholder (Enviroment variables)

◆ ResolvePlaceholder()

String Arp::System::Commons::Xml::XmlSerializationContext::ResolvePlaceholder ( const char *  input)
inline

summary>Adds a xml file to the list of included files

◆ WriteDocumentContext()

void Arp::System::Commons::Xml::XmlSerializationContext::WriteDocumentContext ( XmlWriter writer) const

summary>this operation should be called while xml serialisation when an unknown xml element is recognized

if the schema version of the file is greater then the schema version implemented a warning is logged otherwise a XmlException is thrown


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