Line | |
---|
1 | #ifndef FACT_Converter
|
---|
2 | #define FACT_Converter
|
---|
3 |
|
---|
4 | #include <vector>
|
---|
5 | #include <ostream>
|
---|
6 |
|
---|
7 | class Converter
|
---|
8 | {
|
---|
9 | private:
|
---|
10 | bool rc;
|
---|
11 | std::ostream &wout;
|
---|
12 | std::vector<char> data;
|
---|
13 |
|
---|
14 | template<class V>
|
---|
15 | void Eval(int i, std::stringstream &line, std::vector<char> &vec) const;
|
---|
16 |
|
---|
17 | template<class T>
|
---|
18 | std::string Get(const char *&data) const;
|
---|
19 |
|
---|
20 | public:
|
---|
21 | Converter(std::ostream &out, const std::string &fmt, const std::string &str);
|
---|
22 | Converter(std::ostream &out, const std::string &fmt, const void *d, int size);
|
---|
23 |
|
---|
24 | const char *Ptr() const { return &*data.begin(); }
|
---|
25 | const std::string Str() const { return std::string(&*data.begin(), data.size()); }
|
---|
26 | char *Ptr() { return &*data.begin(); }
|
---|
27 | int Size() const { return data.size(); }
|
---|
28 | bool GetRc() const { return rc; }
|
---|
29 |
|
---|
30 |
|
---|
31 | };
|
---|
32 |
|
---|
33 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.