12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- #ifndef cmProcessOutput_h
- #define cmProcessOutput_h
- #include "cmConfigure.h"
- #include <stddef.h>
- #include <string>
- #include <vector>
- class cmProcessOutput
- {
- public:
- enum Encoding
- {
- None,
- Auto,
- UTF8,
- ANSI,
- OEM
- };
-
- static Encoding FindEncoding(std::string const& name);
-
- static unsigned int defaultCodepage;
-
- cmProcessOutput(Encoding encoding = Auto, unsigned int maxSize = 1024);
- ~cmProcessOutput();
-
- bool DecodeText(std::string raw, std::string& decoded, size_t id = 0);
-
- bool DecodeText(const char* data, size_t length, std::string& decoded,
- size_t id = 0);
-
- bool DecodeText(std::vector<char> raw, std::vector<char>& decoded,
- size_t id = 0);
- private:
- #if defined(_WIN32)
- unsigned int codepage;
- unsigned int bufferSize;
- std::vector<std::string> rawparts;
- bool DoDecodeText(std::string raw, std::string& decoded, wchar_t* lastChar);
- #endif
- };
- #endif
|