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