4#include <system/text/encoding.h>
16 class UTF7Decoder :
public Decoder
27 ASPOSECPP_SHARED_API UTF7Decoder();
34 ASPOSECPP_SHARED_API
int GetCharCount(
const uint8_t* bytes,
int count,
bool flush)
override;
44 ASPOSECPP_SHARED_API
void Convert(
const uint8_t* bytes,
int byte_count, char_t* chars,
int char_count,
bool flush,
int& bytes_used,
int& chars_used,
bool& completed)
override;
49 class UTF7Encoder :
public Encoder
53 bool m_allow_optionals;
65 ASPOSECPP_SHARED_API UTF7Encoder(
bool allow_optionals);
72 ASPOSECPP_SHARED_API
int GetByteCount(
const char_t* chars,
int count,
bool flush)
override;
82 ASPOSECPP_SHARED_API
void Convert(
const char_t* chars,
int char_count, uint8_t* bytes,
int byte_count,
bool flush,
int& chars_used,
int& bytes_used,
bool& completed)
override;
87 static constexpr int UTF7_CODE_PAGE = 65000;
91 bool m_allow_optionals;
97 static const String base64_chars;
173 ASPOSECPP_SHARED_API
int GetByteCount(
const char_t* chars,
int count)
override;
181 ASPOSECPP_SHARED_API
int GetBytes(
const char_t* chars,
int char_count, uint8_t* bytes,
int byte_count)
override;
195 ASPOSECPP_SHARED_API
int GetCharCount(
const uint8_t* bytes,
int count)
override;
202 ASPOSECPP_SHARED_API
int GetChars(
const uint8_t* bytes,
int byte_count, char_t* chars,
int char_count)
override;
213 void InitializeInstanceFields();
225 static int InternalGetByteCount(
const char_t* chars,
int chars_count,
int index,
int count,
bool flush,
int left_over,
bool is_in_shifted,
bool allow_optionals);
237 static int InternalGetBytes(
const ArrayPtr<char_t>& chars,
int char_index,
int char_count,
const ArrayPtr<uint8_t>& bytes,
int byte_index,
bool flush,
int& left_over,
bool& is_in_shifted,
bool allow_optionals);
248 static int InternalGetBytes(
const char_t* chars,
int char_count, uint8_t* bytes,
int byte_count,
bool flush,
int& left_over,
bool& is_in_shifted,
bool allow_optionals);
257 static int InternalGetCharCount(
const uint8_t* bytes,
int bytes_count,
int index,
int count,
int left_over);
275 static int InternalGetChars(
const uint8_t* bytes,
int& byte_count, char_t* chars,
int char_count,
int& left_over,
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
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.
Encapsulates encoding character sequence into byte sequence. Objects of this class should only be all...
Definition: encoder.h:18
virtual int GetByteCount(ArrayPtr< char_t > chars, int index, int count, bool flush)
Gets the number of bytes needed to encode 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.
Encoding services.
Definition: encoding.h:67
virtual int GetByteCount(ArrayPtr< char_t > chars, int index, int count)
Get the number of characters needed to encode a character buffer.
virtual int GetBytes(ArrayPtr< char_t > chars, int char_index, int char_count, ArrayPtr< uint8_t > bytes, int byte_index)
Get the bytes that result from encoding a character buffer.
virtual int GetCharCount(ArrayPtr< uint8_t > bytes, int index, int count)
Get the number of characters needed to decode a byte buffer.
virtual String GetString(uint8_t *bytes, int byte_count)
Decodes a buffer of bytes into a string.
virtual int GetChars(ArrayPtr< uint8_t > bytes, int byte_index, int byte_count, ArrayPtr< char_t > chars, int char_index)
Get the characters that result from decoding a byte buffer.
UTF-7 encoding. Objects of this class should only be allocated using System::MakeObject() function....
Definition: utf7_encoding.h:13
int GetByteCount(const char_t *chars, int count) override
Get the number of characters needed to encode a character buffer.
String GetString(ArrayPtr< uint8_t > bytes, int index, int count) override
Decodes a buffer of bytes into a string.
int GetBytes(ArrayPtr< char_t > chars, int char_index, int char_count, ArrayPtr< uint8_t > bytes, int byte_index) override
Get the bytes that result from encoding a character buffer.
int GetChars(ArrayPtr< uint8_t > bytes, int byte_index, int byte_count, ArrayPtr< char_t > chars, int char_index) override
Get the characters that result from decoding a byte buffer.
bool Equals(SharedPtr< Object > obj) override
Compares with object.
SharedPtr< Object > Clone() override
Clones encoding object.
int GetMaxCharCount(int byte_count) override
Get the maximum number of characters needed to decode a specified number of bytes.
int GetHashCode() const override
Gets encoding hash code.
int GetChars(const uint8_t *bytes, int byte_count, char_t *chars, int char_count) override
Get the characters that result from decoding a byte buffer.
int GetCharCount(const uint8_t *bytes, int count) override
Get the number of characters needed to decode a byte buffer.
int GetBytes(const String &s, int char_index, int char_count, ArrayPtr< uint8_t > bytes, int byte_index) override
Get the bytes that result from encoding a character buffer.
bool operator==(const UTF7Encoding &other) const
Compares encodings parameters.
EncoderPtr GetEncoder() override
Get an encoder that forwards requests to this object.
int GetMaxByteCount(int char_count) override
Get the maximum number of bytes needed to encode a specified number of characters.
DecoderPtr GetDecoder() override
Get a decoder that forwards requests to this object.
int GetBytes(const char_t *chars, int char_count, uint8_t *bytes, int byte_count) override
Get the bytes that result from encoding a character buffer.
UTF7Encoding()
Constructor.
UTF7Encoding(bool allow_optionals)
Constructor.
int GetCharCount(ArrayPtr< uint8_t > bytes, int index, int count) override
Get the number of characters needed to decode a byte buffer.
@ Text
Defines color adjustment information for text.
Definition: db_command.h:9
The structure that contains methods performing conversion of values of one type to the values of anot...
Definition: convert.h:44