#include <Attribute.hpp>

Inheritance diagram for exml::internal::Attribute:
exml::internal::Node ememory::EnableSharedFromThis< Node > ememory::EnableSharedFromThisBase

Public Member Functions

virtual void setName (const std::string &_name)
 
virtual const std::string & getName () const
 
enum nodeType getType () const override
 
bool iParse (const std::string &_data, int32_t &_pos, bool _caseSensitive, exml::FilePos &_filePos, exml::internal::Document &_doc) override
 
bool iGenerate (std::string &_data, int32_t _indent) const override
 
ememory::SharedPtr< exml::internal::AttributetoAttribute () override
 
const ememory::SharedPtr< exml::internal::AttributetoAttribute () const override
 
void clear () override
 
- Public Member Functions inherited from exml::internal::Node
virtual ~Node ()=default
 
const exml::FilePosgetPos () const
 
virtual void setValue (std::string _value)
 
virtual const std::string & getValue () const
 
virtual ememory::SharedPtr< exml::internal::DocumenttoDocument ()
 
virtual const ememory::SharedPtr< exml::internal::DocumenttoDocument () const
 
virtual ememory::SharedPtr< exml::internal::CommenttoComment ()
 
virtual const ememory::SharedPtr< exml::internal::CommenttoComment () const
 
virtual ememory::SharedPtr< exml::internal::DeclarationtoDeclaration ()
 
virtual const ememory::SharedPtr< exml::internal::DeclarationtoDeclaration () const
 
virtual ememory::SharedPtr< exml::internal::ElementtoElement ()
 
virtual const ememory::SharedPtr< exml::internal::ElementtoElement () const
 
virtual ememory::SharedPtr< exml::internal::TexttoText ()
 
virtual const ememory::SharedPtr< exml::internal::TexttoText () const
 
bool isDocument () const
 
bool isAttribute () const
 
bool isComment () const
 
bool isDeclaration () const
 
bool isElement () const
 
bool isText () const
 
- Public Member Functions inherited from ememory::EnableSharedFromThis< Node >
ememory::SharedPtr< EMEMORY_TYPE > sharedFromThis ()
 
const ememory::SharedPtr< EMEMORY_TYPE > sharedFromThis () const
 
ememory::WeakPtr< EMEMORY_TYPE > weakFromThis ()
 
const ememory::WeakPtr< EMEMORY_TYPE > weakFromThis () const
 

Static Public Member Functions

static ememory::SharedPtr< Attributecreate (const std::string &_name="", const std::string &_value="")
 

Protected Member Functions

 Attribute (const std::string &_name="", const std::string &_value="")
 
- Protected Member Functions inherited from exml::internal::Node
 Node ()
 
 Node (const std::string &_value)
 
void addIndent (std::string &_data, int32_t _indent) const
 
void drawElementParsed (char32_t _val, const exml::FilePos &_filePos) const
 
bool checkAvaillable (char32_t _val, bool _firstChar) const
 
int32_t countWhiteChar (const std::string &_data, int32_t _pos, exml::FilePos &_filePos) const
 

Protected Attributes

std::string m_name
 
- Protected Attributes inherited from exml::internal::Node
exml::FilePos m_pos
 
std::string m_value
 

Detailed Description

Single attribute element.

Constructor & Destructor Documentation

§ Attribute()

exml::internal::Attribute::Attribute ( const std::string &  _name = "",
const std::string &  _value = "" 
)
protected

Constructor.

Parameters
[in]_nameName of the attribute.
[in]_valueValue of the attribute.

Member Function Documentation

§ clear()

void exml::internal::Attribute::clear ( )
overridevirtual

clear the Node

Reimplemented from exml::internal::Node.

§ create()

static ememory::SharedPtr<Attribute> exml::internal::Attribute::create ( const std::string &  _name = "",
const std::string &  _value = "" 
)
static

defined factory

Parameters
[in]_nameName of the attribute
[in]_valueValue of the attribute
Returns
Shared pointer on the Attribute element

§ getName()

virtual const std::string& exml::internal::Attribute::getName ( ) const
inlinevirtual

get the current name of the Attribute

Returns
String of the attribute

§ getType()

enum nodeType exml::internal::Attribute::getType ( ) const
inlineoverridevirtual

get the node type.

Returns
the type of the Node.

Reimplemented from exml::internal::Node.

§ iGenerate()

bool exml::internal::Attribute::iGenerate ( std::string &  _data,
int32_t  _indent 
) const
overridevirtual

generate a string with the tree of the xml

Parameters
[in,out]_datastring where to add the elements
[in]_indentcurrent indentation of the file
Returns
false if an error occured.

Reimplemented from exml::internal::Node.

§ iParse()

bool exml::internal::Attribute::iParse ( const std::string &  _data,
int32_t &  _pos,
bool  _caseSensitive,
exml::FilePos _filePos,
exml::internal::Document _doc 
)
overridevirtual

parse the Current node [pure VIRUAL]

Parameters
[in]_datadata string to parse.
[in,out]_posposition in the string to start parse, return the position end of parsing.
[in]_caseSensitiveRequest a parsion of element that is not case sensitive (all element is in low case)
[in,out]_filePosfile parsing position (line x col x)
[in,out]_docBase document reference
Returns
false if an error occured.

Implements exml::internal::Node.

§ setName()

virtual void exml::internal::Attribute::setName ( const std::string &  _name)
inlinevirtual

set the name of the attribute

Parameters
[in]_nameNew name of the attribute

§ toAttribute() [1/2]

ememory::SharedPtr<exml::internal::Attribute> exml::internal::Attribute::toAttribute ( )
inlineoverridevirtual

Cast the element in a Attribute if it is possible.

Returns
pointer on the class or nullptr.

Reimplemented from exml::internal::Node.

§ toAttribute() [2/2]

const ememory::SharedPtr<exml::internal::Attribute> exml::internal::Attribute::toAttribute ( ) const
inlineoverridevirtual

Cast the element in a Attribute if it is possible.

Returns
CONST pointer on the class or nullptr.

Reimplemented from exml::internal::Node.

Member Data Documentation

§ m_name

std::string exml::internal::Attribute::m_name
protected

Name of the attribute.


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