MLBookProc 1.0
 
Loading...
Searching...
No Matches
XMLTag Class Reference

The XMLTag class. More...

#include <XMLTag.h>

Public Member Functions

 XMLTag ()
 XMLTag constructor.
 
 XMLTag (const XMLTag &other)
 XMLTag copy constructor.
 
XMLTagoperator= (const XMLTag &other)
 operator =
 
 XMLTag (XMLTag &&other)
 XMLTag move constructor.
 
XMLTagoperator= (XMLTag &&other)
 operator =
 
bool hasContent () const
 Checks if tag has content.
 

Public Attributes

std::string element
 Tag start element content.
 
std::string tag_id
 Tag name.
 
std::string::size_type content_start
 Index of first byte of tag content.
 
std::string::size_type content_end
 Index of last byte of tag content.
 
std::vector< XMLTagtag_list
 List of XML tags, found in tag content (if any).
 

Detailed Description

The XMLTag class.

Auxiliary class for XMLParser. Contains tag start element content, tag name, index of tag content first byte in XML document and index of content last byte. Also contains list of tags were found in tag content.

Member Function Documentation

◆ hasContent()

bool XMLTag::hasContent ( ) const

Checks if tag has content.

This method returns true, if content_start and content_end are not equal to std::string::npos.

Returns
true if tag has content.

Member Data Documentation

◆ content_end

std::string::size_type XMLTag::content_end

Index of last byte of tag content.

Index of last byte of tag content in XML document. Can be equal to std::string::npos, if tag does not have content.

◆ content_start

std::string::size_type XMLTag::content_start

Index of first byte of tag content.

Index of first byte of tag content in XML document. Start of tag can be found by element size subtration from content_start. If content_start value is equal to std::string::npos, it indicates error on tag reading (even if tag does not have any content).

◆ element

std::string XMLTag::element

Tag start element content.

Tag start element content including opening "<" and closing ">" symbols.