ROSE  0.11.145.0
Public Types | Public Member Functions | Protected Attributes | List of all members
Rose::BinaryAnalysis::Strings::CharacterEncodingForm Class Referenceabstract

Description

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).

Definition at line 221 of file String.h.

#include <Rose/BinaryAnalysis/String.h>

Inheritance diagram for Rose::BinaryAnalysis::Strings::CharacterEncodingForm:
Inheritance graph
[legend]
Collaboration diagram for Rose::BinaryAnalysis::Strings::CharacterEncodingForm:
Collaboration graph
[legend]

Public Types

typedef Sawyer::SharedPointer< CharacterEncodingFormPtr
 Shared ownership pointer to a CharacterEncodingForm. More...
 

Public Member Functions

virtual Ptr clone () const =0
 Create a new encoder from this one. More...
 
virtual std::string name () const =0
 Name of encoder. More...
 
virtual CodeValues encode (CodePoint)=0
 Encode a code point into a sequence of one or more code values. More...
 
State state () const
 Decoder state. More...
 
virtual State decode (CodeValue)=0
 Decode one code value. More...
 
virtual CodePoint consume ()=0
 Consume a decoded code point. More...
 
virtual void reset ()=0
 Reset the decoder state machine. More...
 
- Public Member Functions inherited from Sawyer::SharedObject
 SharedObject ()
 Default constructor. More...
 
 SharedObject (const SharedObject &)
 Copy constructor. More...
 
virtual ~SharedObject ()
 Virtual destructor. More...
 
SharedObjectoperator= (const SharedObject &)
 Assignment. More...
 

Protected Attributes

State state_ = INITIAL_STATE
 

Member Typedef Documentation

Shared ownership pointer to a CharacterEncodingForm.

See Shared ownership.

Definition at line 229 of file String.h.

Member Function Documentation

virtual Ptr Rose::BinaryAnalysis::Strings::CharacterEncodingForm::clone ( ) const
pure virtual
virtual std::string Rose::BinaryAnalysis::Strings::CharacterEncodingForm::name ( ) const
pure virtual
virtual CodeValues Rose::BinaryAnalysis::Strings::CharacterEncodingForm::encode ( CodePoint  )
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::Utf16CharacterEncodingForm, Rose::BinaryAnalysis::Strings::Utf8CharacterEncodingForm, and Rose::BinaryAnalysis::Strings::NoopCharacterEncodingForm.

State Rose::BinaryAnalysis::Strings::CharacterEncodingForm::state ( ) const
inline

Decoder state.

Definition at line 243 of file String.h.

virtual State Rose::BinaryAnalysis::Strings::CharacterEncodingForm::decode ( CodeValue  )
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 State for restrictions on state transitions.

Implemented in Rose::BinaryAnalysis::Strings::Utf16CharacterEncodingForm, Rose::BinaryAnalysis::Strings::Utf8CharacterEncodingForm, and Rose::BinaryAnalysis::Strings::NoopCharacterEncodingForm.

virtual CodePoint Rose::BinaryAnalysis::Strings::CharacterEncodingForm::consume ( )
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::Utf16CharacterEncodingForm, Rose::BinaryAnalysis::Strings::Utf8CharacterEncodingForm, and Rose::BinaryAnalysis::Strings::NoopCharacterEncodingForm.

virtual void Rose::BinaryAnalysis::Strings::CharacterEncodingForm::reset ( )
pure virtual

The documentation for this class was generated from the following file: