ROSE 0.11.145.147
|
Defines mapping between code points and code values.
A code point represents one character of a coded character set, such as one character of approximately 1.4 million distinct Unicode characters. The CharacterEncodingForm (CEF) is responsible for converting a code point to a sequence of one or more code values, or vice versa. Each code value, which may be multiple bytes, is eventually encoded into a sequence of octets by the CharacterEncodingScheme (CES).
#include <Rose/BinaryAnalysis/String.h>
Public Types | |
typedef Sawyer::SharedPointer< CharacterEncodingForm > | Ptr |
Shared ownership pointer to a CharacterEncodingForm. | |
Public Member Functions | |
virtual Ptr | clone () const =0 |
Create a new encoder from this one. | |
virtual std::string | name () const =0 |
Name of encoder. | |
virtual CodeValues | encode (CodePoint)=0 |
Encode a code point into a sequence of one or more code values. | |
State | state () const |
Decoder state. | |
virtual State | decode (CodeValue)=0 |
Decode one code value. | |
virtual CodePoint | consume ()=0 |
Consume a decoded code point. | |
virtual void | reset ()=0 |
Reset the decoder state machine. | |
Public Member Functions inherited from Sawyer::SharedObject | |
SharedObject () | |
Default constructor. | |
SharedObject (const SharedObject &) | |
Copy constructor. | |
virtual | ~SharedObject () |
Virtual destructor. | |
SharedObject & | operator= (const SharedObject &) |
Assignment. | |
Protected Attributes | |
State | state_ = INITIAL_STATE |
typedef Sawyer::SharedPointer<CharacterEncodingForm> Rose::BinaryAnalysis::Strings::CharacterEncodingForm::Ptr |
Shared ownership pointer to a CharacterEncodingForm.
See Shared ownership.
|
inline |
|
inlinevirtual |
|
pure virtual |
Create a new encoder from this one.
Implemented in Rose::BinaryAnalysis::Strings::NoopCharacterEncodingForm, Rose::BinaryAnalysis::Strings::Utf8CharacterEncodingForm, and Rose::BinaryAnalysis::Strings::Utf16CharacterEncodingForm.
|
pure virtual |
|
pure virtual |
Encode a code point into a sequence of one or more code values.
For instance, an ecoder for UTF-16 will encode a code point into one or more values in the range 0 through (2^16)-1.
Implemented in Rose::BinaryAnalysis::Strings::NoopCharacterEncodingForm, Rose::BinaryAnalysis::Strings::Utf8CharacterEncodingForm, and Rose::BinaryAnalysis::Strings::Utf16CharacterEncodingForm.
|
inline |
|
pure virtual |
Decode one code value.
Processes a single code value and updates the decoder state machine. Returns the decoder's new state. See documentation for Strings::State for restrictions on state transitions.
Implemented in Rose::BinaryAnalysis::Strings::NoopCharacterEncodingForm, Rose::BinaryAnalysis::Strings::Utf8CharacterEncodingForm, and Rose::BinaryAnalysis::Strings::Utf16CharacterEncodingForm.
|
pure virtual |
Consume a decoded code point.
The decoder must be in the FINAL_STATE or COMPLETED_STATE, and upon return will be in the INITIAL_STATE.
Implemented in Rose::BinaryAnalysis::Strings::NoopCharacterEncodingForm, Rose::BinaryAnalysis::Strings::Utf8CharacterEncodingForm, and Rose::BinaryAnalysis::Strings::Utf16CharacterEncodingForm.
|
pure virtual |
Reset the decoder state machine.
Implemented in Rose::BinaryAnalysis::Strings::NoopCharacterEncodingForm, Rose::BinaryAnalysis::Strings::Utf8CharacterEncodingForm, and Rose::BinaryAnalysis::Strings::Utf16CharacterEncodingForm.
|
protected |