Text.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 {
16  class Text : public exml::internal::Node {
17  protected:
21  Text() { };
26  Text(const std::string& _data) : exml::internal::Node(_data) { };
27  public:
33  static ememory::SharedPtr<exml::internal::Text> create(const std::string& _data="");
38  int32_t countLines() const;
39  public:
40  enum nodeType getType() const override{
41  return nodeType::text;
42  };
43  bool iParse(const std::string& _data,
44  int32_t& _pos,
45  bool _caseSensitive,
46  exml::FilePos& _filePos,
47  exml::internal::Document& _doc) override;
48  bool iGenerate(std::string& _data, int32_t _indent) const override;
50  return ememory::staticPointerCast<exml::internal::Text>(sharedFromThis());
51  };
53  return ememory::staticPointerCast<exml::internal::Text>(sharedFromThis());
54  };
55  };
60  protected:
64  TextCDATA() { };
65  public:
71  public:
72  bool iParse(const std::string& _data,
73  int32_t& _pos,
74  bool _caseSensitive,
75  exml::FilePos& _filePos,
76  exml::internal::Document& _doc) override;
77  bool iGenerate(std::string& _data, int32_t _indent) const override;
78  };
79  }
80 }
81 
static ememory::SharedPtr< exml::internal::Text > create(const std::string &_data="")
defined factory
const ememory::SharedPtr< exml::internal::Text > toText() const override
Cast the element in a Text if it is possible.
Definition: Text.hpp:52
ememory::SharedPtr< EMEMORY_TYPE > sharedFromThis()
<XXX> InsideText </XXX>
ememory::SharedPtr< exml::internal::Text > toText() override
Cast the element in a Text if it is possible.
Definition: Text.hpp:49
Text()
Constructor.
Definition: Text.hpp:21
exml namespace containing all function for XML interpretor
Definition: Attribute.hpp:11
TextCDATA()
Constructor.
Definition: Text.hpp:64
Text(const std::string &_data)
Constructor.
Definition: Text.hpp:26
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]
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
int32_t countLines() const
count the number of line in the current text
enum nodeType getType() const override
get the node type.
Definition: Text.hpp:40
Text node interface (internal data between two balise : <XXX> ALL here </XXX>.
Definition: Text.hpp:16
bool iGenerate(std::string &_data, int32_t _indent) const override
generate a string with the tree of the xml
Text node interface for balise CDATA <![CDATA[*******]]>.
Definition: Text.hpp:59
nodeType
Type of the XML elements.
Definition: nodeType.hpp:17