]> granicus.if.org Git - icinga2/blob - lib/base/stringbuilder.hpp
Merge pull request #7002 from Icinga/bugfix/check_network-percent-6155
[icinga2] / lib / base / stringbuilder.hpp
1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2
3 #ifndef STRINGBUILDER_H
4 #define STRINGBUILDER_H
5
6 #include "base/i2-base.hpp"
7 #include "base/string.hpp"
8 #include <string>
9 #include <vector>
10
11 namespace icinga
12 {
13
14 /**
15  * A string builder.
16  *
17  * @ingroup base
18  */
19 class StringBuilder final
20 {
21 public:
22         void Append(const String&);
23         void Append(const std::string&);
24         void Append(const char *, const char *);
25         void Append(const char *);
26         void Append(char);
27
28         String ToString() const;
29
30 private:
31         std::vector<char> m_Buffer;
32 };
33
34 }
35
36 #endif /* STRINGBUILDER_H */