| 13 | namespace fusion { |
| 14 | |
| 15 | class Str |
| 16 | { |
| 17 | public: |
| 18 | explicit Str(const std::string& s) : |
| 19 | m_str(s) |
| 20 | { |
| 21 | } |
| 22 | |
| 23 | explicit Str(const char* s) : |
| 24 | m_str(s) |
| 25 | { |
| 26 | } |
| 27 | |
| 28 | explicit Str(const std::wstring& s) : |
| 29 | m_str(Win32::WideCharToMultiByte(s)) |
| 30 | { |
| 31 | } |
| 32 | |
| 33 | explicit Str(const wchar_t* s) : |
| 34 | m_str(Win32::WideCharToMultiByte(s)) |
| 35 | { |
| 36 | } |
| 37 | |
| 38 | std::string str() const |
| 39 | { |
| 40 | return m_str; |
| 41 | } |
| 42 | |
| 43 | const char* c_str() const |
| 44 | { |
| 45 | return m_str.c_str(); |
| 46 | } |
| 47 | |
| 48 | operator std::string() const |
| 49 | { |
| 50 | return m_str; |
| 51 | } |
| 52 | |
| 53 | operator const char*() const |
| 54 | { |
| 55 | return m_str.c_str(); |
| 56 | } |
| 57 | |
| 58 | private: |
| 59 | std::string m_str; |
| 60 | }; |
| 61 | |
| 62 | class WStr |
| 63 | { |
no test coverage detected