characters.h
Go to the documentation of this file.
1 /*
2  * This library is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU Lesser General Public
4  * License as published by the Free Software Foundation; either
5  * version 2.1 of the License, or (at your option) any later version.
6  *
7  * As a special exception, you may use this file as part of a free
8  * software library without restriction. Specifically, if other files
9  * instantiate templates or use macros or inline functions from this
10  * file, or you compile this file and link it with other files to
11  * produce an executable, this file does not by itself cause the
12  * resulting executable to be covered by the GNU General Public
13  * License. This exception does not however invalidate any other
14  * reasons why the executable file might be covered by the GNU Library
15  * General Public License.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with this library; if not, write to the Free Software
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25  */
26 #ifndef cxxtools_xml_Characters_h
27 #define cxxtools_xml_Characters_h
28 
29 #include <cxxtools/xml/api.h>
30 #include <cxxtools/xml/node.h>
31 #include <cxxtools/string.h>
32 
33 namespace cxxtools {
34 
35  namespace xml {
36 
52  {
53  public:
60  explicit Characters( const String& content = String() )
61  : Node(Node::Characters), _content(content)
62  { }
63 
68  Characters* clone() const
69  { return new Characters(*this); }
70 
75  bool empty() const
76  { return _content.empty(); }
77 
78  void clear()
79  { _content.clear(); }
80 
91  String& content()
92  { return _content; }
93 
104  const String& content() const
105  { return _content; }
106 
111  void setContent(const String& content)
112  { _content = content; }
113 
123  virtual bool operator==(const Node& node) const;
124 
125  private:
127  String _content;
128  };
129 
130  }
131 
132 }
133 
134 #endif