ROSE 0.11.145.192
|
Defines the mapping between code values and octets.
A code value (one or more of which compose a code point, or a single character in a coded character set), is encoded as one or more octets. For instance, a UTF-16 code value will be converted to two octets in big or little endian order depending on the character encoding scheme.
#include <Rose/BinaryAnalysis/String.h>
Public Types | |
typedef Sawyer::SharedPointer< CharacterEncodingScheme > | Ptr |
Shared ownership pointer to a CharacterEncodingScheme. | |
Public Member Functions | |
virtual Ptr | clone () const =0 |
Create a new copy of this encoder. | |
virtual std::string | name () const =0 |
Name of encoder. | |
virtual Octets | encode (CodeValue)=0 |
Encode a code value into a sequence of octets. | |
State | state () const |
Decoder state. | |
virtual State | decode (Octet)=0 |
Decode one octet. | |
virtual CodeValue | consume ()=0 |
Consume a decoded code value. | |
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<CharacterEncodingScheme> Rose::BinaryAnalysis::Strings::CharacterEncodingScheme::Ptr |
Shared ownership pointer to a CharacterEncodingScheme.
See Shared ownership.
|
inline |
|
inlinevirtual |
|
pure virtual |
Create a new copy of this encoder.
Implemented in Rose::BinaryAnalysis::Strings::BasicCharacterEncodingScheme.
|
pure virtual |
Name of encoder.
Implemented in Rose::BinaryAnalysis::Strings::BasicCharacterEncodingScheme.
|
pure virtual |
Encode a code value into a sequence of octets.
For instance, an encoder for UTF-16 will encode a code value into two octets.
Implemented in Rose::BinaryAnalysis::Strings::BasicCharacterEncodingScheme.
|
inline |
Decode one octet.
Processes a single octet 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::BasicCharacterEncodingScheme.
|
pure virtual |
Consume a decoded code value.
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::BasicCharacterEncodingScheme.
|
pure virtual |
Reset the decoder state machine.
Implemented in Rose::BinaryAnalysis::Strings::BasicCharacterEncodingScheme.
|
protected |