Jameo Core Library
Loading...
Searching...
No Matches
Public Member Functions | List of all members
jm::CharsetDecoder Class Referenceabstract

The class Charset is a mapping function to make a string out of arbitrarily coded C-strings, or vice versa. More...

Inheritance diagram for jm::CharsetDecoder:
jm::Object jm::MacRomanDecoder jm::RawDecoder jm::UTF16Decoder jm::UTF8Decoder jm::Windows1252Decoder

Public Member Functions

 CharsetDecoder ()
 Constructor.
 
 ~CharsetDecoder () override=default
 Destructor.
 
virtual CharArray decode (const char *cString)=0
 This method decodes a C-string using the encoding implemented in the decoder and converts it into a Unicode-encoded chararray.
 
virtual ByteArray encode (const CharArray &string)=0
 This Method encodes the given string into an encoded String using the encoding implemented in the decoder.
 
- Public Member Functions inherited from jm::Object
 Object () noexcept
 Constructor.
 
virtual ~Object () noexcept
 Destructor.
 
void release () noexcept
 Decreases the reference counter and releases the object immediately when the reference counter becomes 0.
 
Objectretain () noexcept
 Increases the reference counter of this object by 1.
 
Objectautorelease () noexcept
 Same function as release(), but releases the object with a delay if the reference counter is 0. AutoreleasePool::drain() must be called in the to release the object.
 
int32 referenceCount () const noexcept
 Returns the value of the reference counter.
 
virtual bool equals (const Object *other) const
 Comparison of objects.
 
virtual String displayName () const
 Returns the display name of the object intended to present to a user.
 
virtual void printDiffInfo (DiffOperation operation, Object *other) const
 Output method for outputting the diff results for the diff algorithm.
 
void setHighBit (bool status) noexcept
 
bool highBit () const noexcept
 

Detailed Description

The class Charset is a mapping function to make a string out of arbitrarily coded C-strings, or vice versa.

Constructor & Destructor Documentation

◆ CharsetDecoder()

jm::CharsetDecoder::CharsetDecoder ( )

Constructor.

◆ ~CharsetDecoder()

jm::CharsetDecoder::~CharsetDecoder ( )
overridedefault

Destructor.

Member Function Documentation

◆ decode()

virtual CharArray jm::CharsetDecoder::decode ( const char *  cString)
pure virtual

This method decodes a C-string using the encoding implemented in the decoder and converts it into a Unicode-encoded chararray.

Parameters
cStringThe C-string that is to be converted.
Returns
The chararray, which contains the Unicode-encoded representation of the C-string.

Implemented in jm::RawDecoder, jm::UTF8Decoder, jm::UTF16Decoder, jm::Windows1252Decoder, and jm::MacRomanDecoder.

◆ encode()

virtual ByteArray jm::CharsetDecoder::encode ( const CharArray string)
pure virtual

This Method encodes the given string into an encoded String using the encoding implemented in the decoder.

Parameters
stringThe Unicode-encoded String be converted.
Returns
A C-string whose coding is determined by this decoder.

Implemented in jm::RawDecoder, jm::UTF8Decoder, jm::UTF16Decoder, jm::Windows1252Decoder, and jm::MacRomanDecoder.