8#include "Arp/System/Commons/Configuration/TicReader.hpp"
9#include "Arp/System/Commons/Configuration/TicSerializationContext.hpp"
11namespace Arp {
namespace System {
namespace Commons {
namespace Configuration
15template<
class TContent>
19 typedef TContent Content;
20 typedef typename TContent::Ptr ContentPtr;
21 typedef std::shared_ptr<TicConfigDocument<TContent>> Ptr;
30 const String& GetDocumentFilename(
void)
const;
31 ContentPtr GetContent(
void);
34 void Load(
const String& filename);
47 ContentPtr contentPtr;
55 : contentPtr(contentPtrArg)
58 if (this->contentPtr ==
nullptr)
60 this->contentPtr = ContentPtr(
new Content());
67 if constexpr (std::is_pointer_v<ContentPtr>)
69 if (this->contentPtr !=
nullptr)
71 delete this->contentPtr;
72 this->contentPtr =
nullptr;
80 return this->contentPtr;
86 return this->documentFilename;
92 TicReader reader = TicReader::Create(filename);
95 this->documentFilename = filename;
96 context.SetFilePath(filename);
101 context.ReadDocumentContext(reader);
103 this->contentPtr->ReadTic(reader, context);
This class represents the Arp String. The implementation is based on std::string.
Definition: String.hpp:39
Definition: TicConfigDocument.hxx:17
TicConfigDocument(ContentPtr contentPtr=nullptr)
Constructs an TicConfigDocument instance.
Definition: TicConfigDocument.hxx:54
~TicConfigDocument(void)
Destructs this instance and frees all resouces.
Definition: TicConfigDocument.hxx:65
Definition: TicReader.hpp:23
Definition: TicSerializationContext.hpp:19
void ReadStartElement(const char *elementName=nullptr)
reads to the next element and test if this is a start element with the given name
Definition: XmlReader.cpp:593
void ReadEndElement(void)
reads until the next end element is reached skips over an empty element
Definition: XmlReader.cpp:714
Root namespace for the PLCnext API