ROSE 0.11.145.147
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 334 of file String.h.

#include <Rose/BinaryAnalysis/String.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.
 

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

Protected Attributes

State state_ = INITIAL_STATE
 

Member Typedef Documentation

◆ Ptr

Shared ownership pointer to a CharacterEncodingScheme.

See Shared ownership.

Definition at line 342 of file String.h.

Constructor & Destructor Documentation

◆ CharacterEncodingScheme()

Rose::BinaryAnalysis::Strings::CharacterEncodingScheme::CharacterEncodingScheme ( )
inline

Definition at line 338 of file String.h.

◆ ~CharacterEncodingScheme()

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

Definition at line 339 of file String.h.

Member Function Documentation

◆ clone()

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

Create a new copy of this encoder.

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

◆ name()

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

◆ encode()

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

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

Decoder state.

Definition at line 355 of file String.h.

◆ decode()

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

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

◆ consume()

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.

◆ reset()

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

Reset the decoder state machine.

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

Member Data Documentation

◆ state_

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

Definition at line 336 of file String.h.


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