ROSE 0.11.145.147
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.
 

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.
 
SharedObjectoperator= (const SharedObject &)
 Assignment.
 

Protected Attributes

State state_ = INITIAL_STATE
 

Member Typedef Documentation

◆ Ptr

Shared ownership pointer to a CharacterEncodingForm.

See Shared ownership.

Definition at line 229 of file String.h.

Constructor & Destructor Documentation

◆ CharacterEncodingForm()

Rose::BinaryAnalysis::Strings::CharacterEncodingForm::CharacterEncodingForm ( )
inline

Definition at line 225 of file String.h.

◆ ~CharacterEncodingForm()

virtual Rose::BinaryAnalysis::Strings::CharacterEncodingForm::~CharacterEncodingForm ( )
inlinevirtual

Definition at line 226 of file String.h.

Member Function Documentation

◆ clone()

virtual Ptr Rose::BinaryAnalysis::Strings::CharacterEncodingForm::clone ( ) const
pure virtual

◆ name()

virtual std::string Rose::BinaryAnalysis::Strings::CharacterEncodingForm::name ( ) const
pure virtual

◆ encode()

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::NoopCharacterEncodingForm, Rose::BinaryAnalysis::Strings::Utf8CharacterEncodingForm, and Rose::BinaryAnalysis::Strings::Utf16CharacterEncodingForm.

◆ state()

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

Decoder state.

Definition at line 243 of file String.h.

◆ decode()

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 Strings::State for restrictions on state transitions.

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

◆ consume()

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::NoopCharacterEncodingForm, Rose::BinaryAnalysis::Strings::Utf8CharacterEncodingForm, and Rose::BinaryAnalysis::Strings::Utf16CharacterEncodingForm.

◆ reset()

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

Member Data Documentation

◆ state_

State Rose::BinaryAnalysis::Strings::CharacterEncodingForm::state_ = INITIAL_STATE
protected

Definition at line 223 of file String.h.


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