Windows1252Encoding.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // Windows1252Encoding.h
  3. //
  4. // $Id: //poco/1.4/Foundation/include/Poco/Windows1252Encoding.h#1 $
  5. //
  6. // Library: Foundation
  7. // Package: Text
  8. // Module: Windows1252Encoding
  9. //
  10. // Definition of the Windows1252Encoding class.
  11. //
  12. // Copyright (c) 2005-2007, Applied Informatics Software Engineering GmbH.
  13. // and Contributors.
  14. //
  15. // SPDX-License-Identifier: BSL-1.0
  16. //
  17. #ifndef Foundation_Windows1252Encoding_INCLUDED
  18. #define Foundation_Windows1252Encoding_INCLUDED
  19. #include "Poco/Foundation.h"
  20. #include "Poco/TextEncoding.h"
  21. namespace Poco {
  22. class Foundation_API Windows1252Encoding: public TextEncoding
  23. /// Windows Codepage 1252 text encoding.
  24. {
  25. public:
  26. Windows1252Encoding();
  27. ~Windows1252Encoding();
  28. const char* canonicalName() const;
  29. bool isA(const std::string& encodingName) const;
  30. const CharacterMap& characterMap() const;
  31. int convert(const unsigned char* bytes) const;
  32. int convert(int ch, unsigned char* bytes, int length) const;
  33. int queryConvert(const unsigned char* bytes, int length) const;
  34. int sequenceLength(const unsigned char* bytes, int length) const;
  35. private:
  36. static const char* _names[];
  37. static const CharacterMap _charMap;
  38. };
  39. } // namespace Poco
  40. #endif // Foundation_Windows1252Encoding_INCLUDED