Attribute.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <exml/internal/Node.hpp>
9 #include <vector>
10 
11 namespace exml {
12  namespace internal {
17  protected:
23  Attribute(const std::string& _name="", const std::string& _value="");
24  public:
31  static ememory::SharedPtr<Attribute> create(const std::string& _name="", const std::string& _value="");
32  protected:
33  std::string m_name;
34  public:
39  virtual void setName(const std::string& _name) {
40  m_name = _name;
41  };
46  virtual const std::string& getName() const {
47  return m_name;
48  };
49  public:
50  enum nodeType getType() const override {
52  };
53  bool iParse(const std::string& _data, int32_t& _pos, bool _caseSensitive, exml::FilePos& _filePos, exml::internal::Document& _doc) override;
54  bool iGenerate(std::string& _data, int32_t _indent) const override;
56  return ememory::staticPointerCast<exml::internal::Attribute>(sharedFromThis());
57  };
59  return ememory::staticPointerCast<exml::internal::Attribute>(sharedFromThis());
60  };
61  void clear() override;
62  };
63  }
64 }
65 
Attribute(const std::string &_name="", const std::string &_value="")
Constructor.
Single attribute element.
Definition: Attribute.hpp:16
ememory::SharedPtr< EMEMORY_TYPE > sharedFromThis()
ememory::SharedPtr< exml::internal::Attribute > toAttribute() override
Cast the element in a Attribute if it is possible.
Definition: Attribute.hpp:55
bool iParse(const std::string &_data, int32_t &_pos, bool _caseSensitive, exml::FilePos &_filePos, exml::internal::Document &_doc) override
parse the Current node [pure VIRUAL]
exml namespace containing all function for XML interpretor
Definition: Attribute.hpp:11
static ememory::SharedPtr< Attribute > create(const std::string &_name="", const std::string &_value="")
defined factory
virtual const std::string & getName() const
get the current name of the Attribute
Definition: Attribute.hpp:46
void clear() override
clear the Node
Basic document element of a document.
Definition: Document.hpp:16
Position in the file of the original data.
Definition: FilePos.hpp:14
Basic main object of all xml elements.
Definition: Node.hpp:43
bool iGenerate(std::string &_data, int32_t _indent) const override
generate a string with the tree of the xml
the <Element ATTRIBUTE="ATTRIBUTE_VALUE" />
nodeType
Type of the XML elements.
Definition: nodeType.hpp:17
const ememory::SharedPtr< exml::internal::Attribute > toAttribute() const override
Cast the element in a Attribute if it is possible.
Definition: Attribute.hpp:58
virtual void setName(const std::string &_name)
set the name of the attribute
Definition: Attribute.hpp:39
std::string m_name
Name of the attribute.
Definition: Attribute.hpp:33
enum nodeType getType() const override
get the node type.
Definition: Attribute.hpp:50