PLCnext API Documentation 25.0.2.69
Public Types | Public Member Functions | List of all members
Arp::Io::Commons::Configuration::TicReader Class Reference

This class is used to read the content of Tic files. More...

#include <TicReader.hpp>

Public Types

using AttributeReader = std::function< void(TicReader &reader, const String &readAttributeName)>
 
using SubelementReader = std::function< void(TicReader &reader, const String &readElementName)>
 
using XmlReader = Arp::System::Commons::Xml::XmlReader
 

Public Member Functions

 TicReader (const TicReader &arg)=delete
 
 TicReader (TicReader &&arg) noexcept
 Default move constructor.
 
TicReaderoperator= (const TicReader &arg)=delete
 
TicReaderoperator= (TicReader &&arg) noexcept
 Default move-assignment operator.
 
 ~TicReader (void)
 Default destructor.
 
 TicReader (XmlReader &&xmlReader)
 Constructs an TicReader instance. More...
 
size_t GetLineNumber (void)
 Returns the current line number of the read Tic document. More...
 
const StringGetDocumentFileName (void)
 Returns the filename of the current Tic document. More...
 
void ReadDocumentStart (String &rootElementName)
 Reads the document type defintion TIC and the root element. More...
 
void ReadDocumentEnd (void)
 Reads the end-tag of the root.
 
void ReadElementContent (const AttributeReader &attributeReader, const SubelementReader &elementReader)
 Reads the content of the current element. More...
 
void Skip (void)
 Skips the content of the current attribute or element. More...
 
String ReadTicAttributeValue (void)
 Reads the value of the current attribute as String. More...
 
template<class T >
ReadTicAttributeValueAs (void)
 Reads the value of the current attribute and converts it to the specified type T . More...
 
Impl & GetImpl (void)
 For internal use only.
 
const Impl & GetImpl (void) const
 

Detailed Description

This class is used to read the content of Tic files.

Constructor & Destructor Documentation

◆ TicReader()

Arp::Io::Commons::Configuration::TicReader::TicReader ( XmlReader &&  xmlReader)
explicit

Constructs an TicReader instance.

Parameters
filenameXmlReader

Member Function Documentation

◆ GetDocumentFileName()

const String & Arp::Io::Commons::Configuration::TicReader::GetDocumentFileName ( void  )

Returns the filename of the current Tic document.

Returns
The filename of current document.

◆ GetLineNumber()

size_t Arp::Io::Commons::Configuration::TicReader::GetLineNumber ( void  )

Returns the current line number of the read Tic document.

Returns
The current line number of the read document.

◆ ReadDocumentStart()

void Arp::Io::Commons::Configuration::TicReader::ReadDocumentStart ( String rootElementName)

Reads the document type defintion TIC and the root element.

Parameters
rootElementNameThe read name of the root element of the Tic file.

◆ ReadElementContent()

void Arp::Io::Commons::Configuration::TicReader::ReadElementContent ( const AttributeReader &  attributeReader,
const SubelementReader &  elementReader 
)

Reads the content of the current element.

This methods reads all attributes and subelements of the current element. For every read attribute the callback TicReader::AttributeReader is called. For every read subelement the callback SubelementReader is called. The subelement reader needs to read the content of the subelement by either calling ReadElementContent again or use ITicSerializable::ReadTic.

Parameters
attributeReaderThe attribute reader is used for reading any attribute.
elementReaderThe element reader is used for reading any sub-element.

◆ ReadTicAttributeValue()

String Arp::Io::Commons::Configuration::TicReader::ReadTicAttributeValue ( void  )

Reads the value of the current attribute as String.

This method should only be used in the attribute reader to read the value of the current attribute. To convert the value into a special type the methodTicReader::ReadTicAttributeAs might be used.

Returns
The read value as String.

◆ ReadTicAttributeValueAs()

template<class T >
T Arp::Io::Commons::Configuration::TicReader::ReadTicAttributeValueAs ( void  )
inline

Reads the value of the current attribute and converts it to the specified type T .

Template Parameters
TThe value type.
Returns
The read attribute value as type T .

◆ Skip()

void Arp::Io::Commons::Configuration::TicReader::Skip ( void  )

Skips the content of the current attribute or element.

This method should be used in the attribute or the element reader to skip the current content. This can be used to skip unknown elements which cannot be handled.


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