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


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
Collaboration diagram for Rose::BinaryAnalysis::Strings::LengthEncodingScheme:
Collaboration graph

Public Types

typedef Sawyer::SharedPointer< LengthEncodingSchemePtr
 Shared ownership pointer to a LengthEncodingScheme. 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 (size_t)=0
 Encode a length into a sequence of octets. More...
State state () const
 Decoder state. More...
virtual State decode (Octet)=0
 Decode one octet. More...
virtual size_t consume ()=0
 Consume a decoded length. 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 LengthEncodingScheme.

See Shared ownership.

Definition at line 417 of file String.h.

Member Function Documentation

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

Create a new copy of this encoder.

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

virtual std::string Rose::BinaryAnalysis::Strings::LengthEncodingScheme::name ( ) const
pure virtual
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 Rose::BinaryAnalysis::Strings::LengthEncodingScheme::state ( ) const

Decoder state.

Definition at line 429 of file String.h.

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

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

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.

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

Reset the decoder state machine.

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

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