CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
icu_decoder.h
1
2#ifndef _aspose_system_text_icu_decoder_h_
3#define _aspose_system_text_icu_decoder_h_
4
5#include "system/text/decoder.h"
6
7struct UConverter;
8
9namespace System {
10
11namespace IO
12{
13 class BinaryReader;
14}
15
16namespace Text {
17
18class ICUEncoding;
21
26class ASPOSECPP_SHARED_CLASS ICUDecoder : public Decoder
27{
28public:
32
34 typedef Decoder Base;
37 ASPOSECPP_SHARED_API ICUDecoder(ICUEncoding *encoding);
39 virtual ASPOSECPP_SHARED_API ~ICUDecoder();
40
42 virtual ASPOSECPP_SHARED_API void Reset();
43
49 virtual int GetCharCount(ArrayPtr<uint8_t> bytes, int index, int count)
50 {
51 return Base::GetCharCount(bytes, index, count);
52 }
59 virtual int GetCharCount(ArrayPtr<uint8_t> bytes, int index, int count, bool flush)
60 {
61 return Base::GetCharCount(bytes, index, count, flush);
62 }
68 virtual ASPOSECPP_SHARED_API int GetCharCount(const uint8_t *bytes, int count, bool flush);
69
77 virtual int GetChars(ArrayPtr<uint8_t> bytes, int byteIndex, int byteCount, ArrayPtr<char_t> chars, int charIndex)
78 {
79 return Base::GetChars(bytes, byteIndex, byteCount, chars, charIndex);
80 }
89 virtual int GetChars(ArrayPtr<uint8_t> bytes, int byteIndex, int byteCount, ArrayPtr<char_t> chars, int charIndex, bool flush)
90 {
91 return Base::GetChars(bytes, byteIndex, byteCount, chars, charIndex, flush);
92 }
100 virtual ASPOSECPP_SHARED_API int GetChars(const uint8_t *bytes, int byteCount, char_t *chars, int charCount, bool flush);
101
113 virtual void Convert(ArrayPtr<uint8_t> bytes, int byteIndex, int byteCount, ArrayPtr<char_t> chars, int charIndex, int charCount, bool flush, int &bytesUsed, int &charsUsed, bool &completed)
114 {
115 Base::Convert(bytes, byteIndex, byteCount, chars, charIndex, charCount, flush, bytesUsed, charsUsed, completed);
116 }
126 virtual ASPOSECPP_SHARED_API void Convert(const uint8_t* bytes, int byteCount, char_t *chars, int charCount, bool flush, int &bytesUsed, int &charsUsed, bool &completed);
127
128private:
130 void SetICUCallbacks();
132 UConverter *m_icu_converter = 0;
133};
134
135}};
136
137
138#endif
Represents a reader that reads primitive data types as binary data in particular encoding....
Definition: binary_reader.h:26
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
Encapsulates decoding byte sequence into character sequence. Objects of this class should only be all...
Definition: decoder.h:19
Decoder that uses ICU for decoding. Objects of this class should only be allocated using System::Make...
Definition: icu_decoder.h:27
virtual int GetChars(const uint8_t *bytes, int byteCount, char_t *chars, int charCount, bool flush)
Get the characters that result from decoding a buffer.
virtual void Convert(ArrayPtr< uint8_t > bytes, int byteIndex, int byteCount, ArrayPtr< char_t > chars, int charIndex, int charCount, bool flush, int &bytesUsed, int &charsUsed, bool &completed)
Converts bytes to characters.
Definition: icu_decoder.h:113
virtual ~ICUDecoder()
Destructor.
virtual int GetCharCount(ArrayPtr< uint8_t > bytes, int index, int count, bool flush)
Gets the number of characters needed to decode a buffer.
Definition: icu_decoder.h:59
Decoder Base
Base type.
Definition: icu_decoder.h:34
ICUDecoder(ICUEncoding *encoding)
Constructor.
virtual void Convert(const uint8_t *bytes, int byteCount, char_t *chars, int charCount, bool flush, int &bytesUsed, int &charsUsed, bool &completed)
Converts bytes to characters.
virtual int GetCharCount(ArrayPtr< uint8_t > bytes, int index, int count)
Gets the number of characters needed to decode a buffer.
Definition: icu_decoder.h:49
virtual int GetChars(ArrayPtr< uint8_t > bytes, int byteIndex, int byteCount, ArrayPtr< char_t > chars, int charIndex, bool flush)
Get the characters that result from decoding a buffer.
Definition: icu_decoder.h:89
virtual void Reset()
Sets internal variables to initial state.
virtual int GetChars(ArrayPtr< uint8_t > bytes, int byteIndex, int byteCount, ArrayPtr< char_t > chars, int charIndex)
Get the characters that result from decoding a buffer.
Definition: icu_decoder.h:77
virtual int GetCharCount(const uint8_t *bytes, int count, bool flush)
Gets the number of characters needed to decode a buffer.
ICU-based encoding implementation. FOR INTERNAL USE. Objects of this class should only be allocated u...
Definition: icu_encoding.h:17
@ Text
Defines color adjustment information for text.
System::SharedPtr< ICUEncoding > ICUEncodingPtr
ICU encoding pointer.
Definition: icu_decoder.h:20
Definition: db_command.h:9