1 | // |
2 | // Windows1251Encoding.h |
3 | // |
4 | // Library: Foundation |
5 | // Package: Text |
6 | // Module: Windows1251Encoding |
7 | // |
8 | // Definition of the Windows1251Encoding class. |
9 | // |
10 | // Copyright (c) 2005-2007, Applied Informatics Software Engineering GmbH. |
11 | // and Contributors. |
12 | // |
13 | // SPDX-License-Identifier: BSL-1.0 |
14 | // |
15 | |
16 | |
17 | #ifndef Foundation_Windows1251Encoding_INCLUDED |
18 | #define Foundation_Windows1251Encoding_INCLUDED |
19 | |
20 | |
21 | #include "Poco/Foundation.h" |
22 | #include "Poco/TextEncoding.h" |
23 | |
24 | |
25 | namespace Poco { |
26 | |
27 | |
28 | class Foundation_API Windows1251Encoding: public TextEncoding |
29 | /// Windows Codepage 1251 text encoding. |
30 | /// Based on: http://msdn.microsoft.com/en-us/goglobal/cc305144 |
31 | { |
32 | public: |
33 | Windows1251Encoding(); |
34 | ~Windows1251Encoding(); |
35 | const char* canonicalName() const; |
36 | bool isA(const std::string& encodingName) const; |
37 | const CharacterMap& characterMap() const; |
38 | int convert(const unsigned char* bytes) const; |
39 | int convert(int ch, unsigned char* bytes, int length) const; |
40 | int queryConvert(const unsigned char* bytes, int length) const; |
41 | int sequenceLength(const unsigned char* bytes, int length) const; |
42 | |
43 | private: |
44 | static const char* _names[]; |
45 | static const CharacterMap _charMap; |
46 | }; |
47 | |
48 | |
49 | } // namespace Poco |
50 | |
51 | |
52 | #endif // Foundation_Windows1251Encoding_INCLUDED |
53 | |