CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
icu_encoder.h
1
2#ifndef _aspose_system_text_icu_encoder_h_
3#define _aspose_system_text_icu_encoder_h_
4
5#include "system/text/encoder.h"
6
7struct UConverter;
8
9namespace System { namespace Text {
10
11class ICUEncoding;
14
19class ASPOSECPP_SHARED_CLASS ICUEncoder : public Encoder
20{
21public:
23 typedef Encoder Base;
26 ASPOSECPP_SHARED_API ICUEncoder(ICUEncoding* encoding);
28 ASPOSECPP_SHARED_API ~ICUEncoder();
29
31 virtual ASPOSECPP_SHARED_API void Reset();
32
39 virtual int GetByteCount(ArrayPtr<char_t> chars, int index, int count, bool flush)
40 {
41 return Base::GetByteCount(chars, index, count, flush);
42 }
48 virtual ASPOSECPP_SHARED_API int GetByteCount(const char_t *chars, int count, bool flush);
49
58 virtual int GetBytes(ArrayPtr<char_t> chars, int charIndex, int charCount, ArrayPtr<uint8_t> bytes, int byteIndex, bool flush)
59 {
60 return Base::GetBytes(chars, charIndex, charCount, bytes, byteIndex, flush);
61 }
69 virtual ASPOSECPP_SHARED_API int GetBytes(const char_t *chars, int charCount, uint8_t *bytes, int byteCount, bool flush);
70
82 virtual void Convert(ArrayPtr<char_t> chars, int charIndex, int charCount, ArrayPtr<uint8_t> bytes, int byteIndex, int byteCount, bool flush, int &charsUsed, int &bytesUsed, bool &completed)
83 {
84 Base::Convert(chars, charIndex, charCount, bytes, byteIndex, byteCount, flush, charsUsed, bytesUsed, completed);
85 }
95 virtual ASPOSECPP_SHARED_API void Convert(const char_t *chars, int charCount, uint8_t *bytes, int byteCount, bool flush, int &charsUsed, int &bytesUsed, bool &completed);
96
97private:
99 void SetICUCallbacks();
101 UConverter *m_icu_converter;
102};
103
104}};
105
106#endif
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
Encapsulates encoding character sequence into byte sequence. Objects of this class should only be all...
Definition: encoder.h:18
Encoder that uses ICU for encoding. Objects of this class should only be allocated using System::Make...
Definition: icu_encoder.h:20
virtual int GetBytes(ArrayPtr< char_t > chars, int charIndex, int charCount, ArrayPtr< uint8_t > bytes, int byteIndex, bool flush)
Get the bytes that result from encoding a buffer.
Definition: icu_encoder.h:58
ICUEncoder(ICUEncoding *encoding)
Constructor.
virtual int GetByteCount(ArrayPtr< char_t > chars, int index, int count, bool flush)
Gets the number of bytes needed to encode a buffer.
Definition: icu_encoder.h:39
virtual void Convert(ArrayPtr< char_t > chars, int charIndex, int charCount, ArrayPtr< uint8_t > bytes, int byteIndex, int byteCount, bool flush, int &charsUsed, int &bytesUsed, bool &completed)
Converts characters to bytes.
Definition: icu_encoder.h:82
virtual int GetByteCount(const char_t *chars, int count, bool flush)
Gets the number of bytes needed to encode a buffer.
virtual void Reset()
Sets internal variables to initial state.
virtual void Convert(const char_t *chars, int charCount, uint8_t *bytes, int byteCount, bool flush, int &charsUsed, int &bytesUsed, bool &completed)
Converts characters to bytes.
Encoder Base
Base type.
Definition: icu_encoder.h:23
virtual int GetBytes(const char_t *chars, int charCount, uint8_t *bytes, int byteCount, bool flush)
Get the bytes that result from encoding 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