CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
utf8_encoding.h
1
2#pragma once
3
4#include <system/text/icu_encoding.h>
5
6namespace System { namespace Text {
7
12class ASPOSECPP_SHARED_CLASS UTF8Encoding : public ICUEncoding
13{
15 RTTI_INFO(System::Text::UTF8Encoding, ::System::BaseTypesInfo<System::Text::ICUEncoding>)
16
17public:
19 static constexpr int UTF8_CODE_PAGE = 65001;
20
22 ASPOSECPP_SHARED_API UTF8Encoding();
25 ASPOSECPP_SHARED_API UTF8Encoding(bool encoder_should_emit_utf8_idetifier);
29 ASPOSECPP_SHARED_API UTF8Encoding(bool encoder_should_emit_utf8_identifier, bool throw_on_invalid_bytes);
30
34 ASPOSECPP_SHARED_API bool operator==(const UTF8Encoding& other) const;
38 ASPOSECPP_SHARED_API bool Equals(SharedPtr<Object> obj) override;
41 ASPOSECPP_SHARED_API int GetHashCode() const override;
42
45 ASPOSECPP_SHARED_API ArrayPtr<uint8_t> GetPreamble() override;
46
49 ASPOSECPP_SHARED_API SharedPtr<Object> Clone() override;
50
54 ASPOSECPP_SHARED_API int GetMaxCharCount(int byte_count) override;
58 ASPOSECPP_SHARED_API int GetMaxByteCount(int char_count) override;
59
60protected:
62 ASPOSECPP_SHARED_API ~UTF8Encoding() override;
63
64private:
66 const bool m_encoder_should_emit_utf8_identifier;
68 const bool m_throw_on_invalid_bytes;
69};
70
71}} // namespace System::Text
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
ICU-based encoding implementation. FOR INTERNAL USE. Objects of this class should only be allocated u...
Definition: icu_encoding.h:17
UTF-8 encoding. Objects of this class should only be allocated using System::MakeObject() function....
Definition: utf8_encoding.h:13
UTF8Encoding(bool encoder_should_emit_utf8_idetifier)
Constructor.
int GetHashCode() const override
Gets encoding hash code.
ArrayPtr< uint8_t > GetPreamble() override
Get codepage preamble.
~UTF8Encoding() override
Destructor.
int GetMaxCharCount(int byte_count) override
Get the maximum number of characters needed to decode a specified number of bytes.
UTF8Encoding(bool encoder_should_emit_utf8_identifier, bool throw_on_invalid_bytes)
Constructor.
bool operator==(const UTF8Encoding &other) const
Compares encodings parameters.
SharedPtr< Object > Clone() override
Clones encoding object.
int GetMaxByteCount(int char_count) override
Get the maximum number of bytes needed to encode a specified number of characters.
bool Equals(SharedPtr< Object > obj) override
Compares with object.
@ Text
Defines color adjustment information for text.
Definition: db_command.h:9