ASCIIEncoding.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // ASCIIEncoding.h
  3. //
  4. // $Id: //poco/1.4/Foundation/include/Poco/ASCIIEncoding.h#1 $
  5. //
  6. // Library: Foundation
  7. // Package: Text
  8. // Module: ASCIIEncoding
  9. //
  10. // Definition of the ASCIIEncoding 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_ASCIIEncoding_INCLUDED
  18. #define Foundation_ASCIIEncoding_INCLUDED
  19. #include "Poco/Foundation.h"
  20. #include "Poco/TextEncoding.h"
  21. namespace Poco {
  22. class Foundation_API ASCIIEncoding: public TextEncoding
  23. /// 7-bit ASCII text encoding.
  24. {
  25. public:
  26. ASCIIEncoding();
  27. ~ASCIIEncoding();
  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_ASCIIEncoding_INCLUDED