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

Description

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.

Definition at line 330 of file BinaryString.h.

#include <BinaryString.h>

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

Public Types

typedef Sawyer::SharedPointer< CharacterEncodingSchemePtr
 Shared ownership pointer to a CharacterEncodingScheme. More...
 

Public Member Functions

virtual Ptr clone () const =0
 Create a new copy of this encoder. More...
 
virtual std::string name () const =0
 Name of encoder. More...
 
virtual Octets encode (CodeValue)=0
 Encode a code value into a sequence of octets. More...
 
State state () const
 Decoder state. More...
 
virtual State decode (Octet)=0
 Decode one octet. More...
 
virtual CodeValue consume ()=0
 Consume a decoded code value. 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_
 

Member Typedef Documentation

Shared ownership pointer to a CharacterEncodingScheme.

See Shared ownership.

Definition at line 338 of file BinaryString.h.

Member Function Documentation

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

Create a new copy of this encoder.

Implemented in Rose::BinaryAnalysis::Strings::BasicCharacterEncodingScheme.

virtual std::string Rose::BinaryAnalysis::Strings::CharacterEncodingScheme::name ( ) const
pure virtual
virtual Octets Rose::BinaryAnalysis::Strings::CharacterEncodingScheme::encode ( CodeValue  )
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.

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

Decoder state.

Definition at line 351 of file BinaryString.h.

virtual State Rose::BinaryAnalysis::Strings::CharacterEncodingScheme::decode ( Octet  )
pure virtual

Decode one octet.

Processes a single octet 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::BasicCharacterEncodingScheme.

virtual CodeValue Rose::BinaryAnalysis::Strings::CharacterEncodingScheme::consume ( )
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.

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

Reset the decoder state machine.

Implemented in Rose::BinaryAnalysis::Strings::BasicCharacterEncodingScheme.


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