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

Description

Encoding for the length of a string.

Strings that are length-encoded must specify a length encoding scheme that gives the length of the string measured in code points.

Definition at line 409 of file String.h.

#include <Rose/BinaryAnalysis/String.h>

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

Public Types

typedef Sawyer::SharedPointer< LengthEncodingSchemePtr
 Shared ownership pointer to a LengthEncodingScheme.
 

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 (size_t)=0
 Encode a length into a sequence of octets.
 
State state () const
 Decoder state.
 
virtual State decode (Octet)=0
 Decode one octet.
 
virtual size_t consume ()=0
 Consume a decoded length.
 
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 LengthEncodingScheme.

See Shared ownership.

Definition at line 417 of file String.h.

Constructor & Destructor Documentation

◆ LengthEncodingScheme()

Rose::BinaryAnalysis::Strings::LengthEncodingScheme::LengthEncodingScheme ( )
inline

Definition at line 413 of file String.h.

◆ ~LengthEncodingScheme()

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

Definition at line 414 of file String.h.

Member Function Documentation

◆ clone()

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

Create a new copy of this encoder.

Implemented in Rose::BinaryAnalysis::Strings::BasicLengthEncodingScheme.

◆ name()

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

◆ encode()

virtual Octets Rose::BinaryAnalysis::Strings::LengthEncodingScheme::encode ( size_t  )
pure virtual

Encode a length into a sequence of octets.

Implemented in Rose::BinaryAnalysis::Strings::BasicLengthEncodingScheme.

◆ state()

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

Decoder state.

Definition at line 429 of file String.h.

◆ decode()

virtual State Rose::BinaryAnalysis::Strings::LengthEncodingScheme::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::BasicLengthEncodingScheme.

◆ consume()

virtual size_t Rose::BinaryAnalysis::Strings::LengthEncodingScheme::consume ( )
pure virtual

Consume a decoded length.

The decoder must be in the FINAL_STATE or COMPLETE_STATE, and upon return will be in the INITIAL_STATE.

Implemented in Rose::BinaryAnalysis::Strings::BasicLengthEncodingScheme.

◆ reset()

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

Reset the decoder state machine.

Implemented in Rose::BinaryAnalysis::Strings::BasicLengthEncodingScheme.

Member Data Documentation

◆ state_

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

Definition at line 411 of file String.h.


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