CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
encoder.h
1
2#ifndef __Encoder_h__
3#define __Encoder_h__
4
5#include "system/array.h"
6#include "system/object.h"
7#include "fwd.h"
8#include "encoder_fallback_buffer.h"
9
10
11namespace System { namespace Text {
12
17class ASPOSECPP_SHARED_CLASS Encoder: public Object
18{
19protected:
21 ASPOSECPP_SHARED_API Encoder();
22
23public:
26 EncoderFallbackPtr get_Fallback() const { return m_fallback; }
29 ASPOSECPP_SHARED_API void set_Fallback(const EncoderFallbackPtr& value);
32 ASPOSECPP_SHARED_API const EncoderFallbackBufferPtr get_FallbackBuffer() const;
33
40 virtual ASPOSECPP_SHARED_API int GetByteCount(ArrayPtr<char_t> chars, int index, int count, bool flush);
46 virtual ASPOSECPP_SHARED_API int GetByteCount(const char_t *chars, int count, bool flush);
47
56 virtual ASPOSECPP_SHARED_API int GetBytes(ArrayPtr<char_t> chars, int charIndex, int charCount, ArrayPtr<uint8_t> bytes, int byteIndex, bool flush);
64 virtual ASPOSECPP_SHARED_API int GetBytes(const char_t *chars, int charCount, uint8_t *bytes, int byteCount, bool flush);
65
67 virtual ASPOSECPP_SHARED_API void Reset();
68
80 virtual ASPOSECPP_SHARED_API 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);
90 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);
91
92private:
94 EncoderFallbackPtr m_fallback;
96 mutable EncoderFallbackBufferPtr m_fallback_buffer;
97};
98
99}}
100
101#endif
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:62
Encapsulates encoding character sequence into byte sequence. Objects of this class should only be all...
Definition: encoder.h:18
void set_Fallback(const EncoderFallbackPtr &value)
Sets error handling fallback.
virtual void Reset()
Cleans encoder internal state.
virtual int GetByteCount(const char_t *chars, int count, bool flush)
Gets the number of bytes needed to encode a buffer.
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.
virtual int GetByteCount(ArrayPtr< char_t > chars, int index, int count, bool flush)
Gets the number of bytes needed to encode a buffer.
Encoder()
Constructor.
EncoderFallbackPtr get_Fallback() const
Gets error handling fallback.
Definition: encoder.h:26
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.
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.
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.
const EncoderFallbackBufferPtr get_FallbackBuffer() const
Gets fallback buffer.
@ Text
Defines color adjustment information for text.
Definition: db_command.h:9