Latin2Encoding.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // Latin2Encoding.h
  3. //
  4. // $Id: //poco/svn/Foundation/include/Poco/Latin2Encoding.h#2 $
  5. //
  6. // Library: Foundation
  7. // Package: Text
  8. // Module: Latin2Encoding
  9. //
  10. // Definition of the Latin2Encoding class.
  11. //
  12. // Copyright (c) 2004-2007, Applied Informatics Software Engineering GmbH.
  13. // and Contributors.
  14. //
  15. // SPDX-License-Identifier: BSL-1.0
  16. //
  17. #ifndef Foundation_Latin2Encoding_INCLUDED
  18. #define Foundation_Latin2Encoding_INCLUDED
  19. #include "Poco/Foundation.h"
  20. #include "Poco/TextEncoding.h"
  21. namespace Poco {
  22. class Foundation_API Latin2Encoding: public TextEncoding
  23. /// ISO Latin-2 (8859-2) text encoding.
  24. ///
  25. /// Latin-2 is basically Latin-1 with the EURO sign plus
  26. /// some other minor changes.
  27. {
  28. public:
  29. Latin2Encoding();
  30. virtual ~Latin2Encoding();
  31. const char* canonicalName() const;
  32. bool isA(const std::string& encodingName) const;
  33. const CharacterMap& characterMap() const;
  34. int convert(const unsigned char* bytes) const;
  35. int convert(int ch, unsigned char* bytes, int length) const;
  36. int queryConvert(const unsigned char* bytes, int length) const;
  37. int sequenceLength(const unsigned char* bytes, int length) const;
  38. private:
  39. static const char* _names[];
  40. static const CharacterMap _charMap;
  41. };
  42. } // namespace Poco
  43. #endif // Foundation_Latin2Encoding_INCLUDED