Debian Codegraph @

yo/concrete/poly/text/text.h

raw
1 #ifndef INCLUDED_TEXT_
2 #define INCLUDED_TEXT_
3
4 #include <string>
5 #include <ostream>
6
7 #include "../base/base.h"
8
9 class Text: public Base
10 {
11 std::string d_text;
12
13 public:
14 Text(char const *id);
15 std::string const &id() const; // directly access the name.
16 private:
17 virtual Base *ownClone() const;
18 virtual std::ostream &insert(std::ostream &os) const;
19 };
20
21 inline Text::Text(char const *id)
22 :
23 d_text(id)
24 {}
25
26 inline Base *Text::ownClone() const
27 {
28 return new Text(*this);
29 }
30
31 inline std::string const &Text::id() const
32 {
33 return d_text;
34 }
35
36 inline std::ostream &Text::insert(std::ostream &out) const
37 {
38 return out << d_text;
39 }
40
41 #endif