CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
decoder.h
1
2#ifndef __Decoder_h__
3#define __Decoder_h__
4
5#include "system/text/decoder_fallback.h"
6#include "system/text/decoder_fallback_buffer.h"
7
8#include "system/array.h"
9#include "system/object.h"
10#include "fwd.h"
11
12namespace System { namespace Text {
13
18class ASPOSECPP_SHARED_CLASS Decoder: public Object
19{
20protected:
22 ASPOSECPP_SHARED_API Decoder();
23
24public:
27 DecoderFallbackPtr get_Fallback() const { return m_fallback; }
30 ASPOSECPP_SHARED_API void set_Fallback(const DecoderFallbackPtr& value);
33 ASPOSECPP_SHARED_API DecoderFallbackBufferPtr get_FallbackBuffer() const;
34
40 virtual ASPOSECPP_SHARED_API int GetCharCount(ArrayPtr<uint8_t> bytes, int index, int count);
47 virtual ASPOSECPP_SHARED_API int GetCharCount(ArrayPtr<uint8_t> bytes, int index, int count, bool flush);
53 virtual ASPOSECPP_SHARED_API int GetCharCount(const uint8_t *bytes, int count, bool flush);
54
62 virtual ASPOSECPP_SHARED_API int GetChars(ArrayPtr<uint8_t> bytes, int byteIndex, int byteCount, ArrayPtr<char_t> chars, int charIndex);
71 virtual ASPOSECPP_SHARED_API int GetChars(ArrayPtr<uint8_t> bytes, int byteIndex, int byteCount, ArrayPtr<char_t> chars, int charIndex, bool flush);
79 virtual ASPOSECPP_SHARED_API int GetChars(const uint8_t *bytes, int byteCount, char_t *chars, int charCount, bool flush);
80
82 virtual ASPOSECPP_SHARED_API void Reset();
83
95 virtual ASPOSECPP_SHARED_API 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);
105 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);
106
107private:
109 DecoderFallbackPtr m_fallback;
111 mutable DecoderFallbackBufferPtr m_fallback_buffer;
112};
113
114}}
115
116#endif
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:62
Encapsulates decoding byte sequence into character sequence. Objects of this class should only be all...
Definition: decoder.h:19
virtual int GetCharCount(ArrayPtr< uint8_t > bytes, int index, int count)
Gets the number of characters needed to decode 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.
virtual void Reset()
Cleans decoder internal state.
DecoderFallbackBufferPtr get_FallbackBuffer() const
Gets fallback buffer.
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.
DecoderFallbackPtr get_Fallback() const
Gets error handling fallback.
Definition: decoder.h:27
virtual int GetCharCount(const uint8_t *bytes, int count, bool flush)
Gets the number of characters needed to decode a buffer.
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.
void set_Fallback(const DecoderFallbackPtr &value)
Sets error handling fallback.
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.
Decoder()
Constructor.
virtual int GetCharCount(ArrayPtr< uint8_t > bytes, int index, int count, bool flush)
Gets the number of characters needed to decode a buffer.
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.
@ Text
Defines color adjustment information for text.
Definition: db_command.h:9