ROSE 0.11.145.192
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Rose::BinaryAnalysis::Strings::BasicLengthEncodingScheme Class Reference

Description

Basic length encoding scheme.

This length encoding scheme converts a length to a sequence of octets in big- or little-endian order, and vice versa. It needs to know the number of octets per length value, and the byte order of the octets if the length is greater than one.

Definition at line 451 of file String.h.

#include <Rose/BinaryAnalysis/String.h>

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

Public Member Functions

virtual Ptr clone () const override
 Create a new copy of this encoder.
 
virtual std::string name () const override
 Name of encoder.
 
virtual Octets encode (size_t) override
 Encode a length into a sequence of octets.
 
virtual State decode (Octet) override
 Decode one octet.
 
virtual size_t consume () override
 Consume a decoded length.
 
virtual void reset () override
 Reset the decoder state machine.
 
- Public Member Functions inherited from Rose::BinaryAnalysis::Strings::LengthEncodingScheme
State state () const
 Decoder state.
 
- Public Member Functions inherited from Sawyer::SharedObject
 SharedObject ()
 Default constructor.
 
 SharedObject (const SharedObject &)
 Copy constructor.
 
virtual ~SharedObject ()
 Virtual destructor.
 
SharedObjectoperator= (const SharedObject &)
 Assignment.
 

Static Public Member Functions

static Ptr instance (size_t octetsPerValue, ByteOrder::Endianness sex=ByteOrder::ORDER_UNSPECIFIED)
 

Protected Member Functions

 BasicLengthEncodingScheme (size_t octetsPerValue, ByteOrder::Endianness sex)
 

Additional Inherited Members

- Public Types inherited from Rose::BinaryAnalysis::Strings::LengthEncodingScheme
typedef Sawyer::SharedPointer< LengthEncodingSchemePtr
 Shared ownership pointer to a LengthEncodingScheme.
 
- Protected Attributes inherited from Rose::BinaryAnalysis::Strings::LengthEncodingScheme
State state_ = INITIAL_STATE
 

Constructor & Destructor Documentation

◆ BasicLengthEncodingScheme()

Rose::BinaryAnalysis::Strings::BasicLengthEncodingScheme::BasicLengthEncodingScheme ( size_t  octetsPerValue,
ByteOrder::Endianness  sex 
)
inlineprotected

Definition at line 456 of file String.h.

Member Function Documentation

◆ instance()

static Ptr Rose::BinaryAnalysis::Strings::BasicLengthEncodingScheme::instance ( size_t  octetsPerValue,
ByteOrder::Endianness  sex = ByteOrder::ORDER_UNSPECIFIED 
)
inlinestatic

Definition at line 462 of file String.h.

◆ clone()

virtual Ptr Rose::BinaryAnalysis::Strings::BasicLengthEncodingScheme::clone ( ) const
inlineoverridevirtual

Create a new copy of this encoder.

Implements Rose::BinaryAnalysis::Strings::LengthEncodingScheme.

Definition at line 465 of file String.h.

◆ name()

virtual std::string Rose::BinaryAnalysis::Strings::BasicLengthEncodingScheme::name ( ) const
overridevirtual

◆ encode()

virtual Octets Rose::BinaryAnalysis::Strings::BasicLengthEncodingScheme::encode ( size_t  )
overridevirtual

Encode a length into a sequence of octets.

Implements Rose::BinaryAnalysis::Strings::LengthEncodingScheme.

◆ decode()

virtual State Rose::BinaryAnalysis::Strings::BasicLengthEncodingScheme::decode ( Octet  )
overridevirtual

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.

Implements Rose::BinaryAnalysis::Strings::LengthEncodingScheme.

◆ consume()

virtual size_t Rose::BinaryAnalysis::Strings::BasicLengthEncodingScheme::consume ( )
overridevirtual

Consume a decoded length.

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

Implements Rose::BinaryAnalysis::Strings::LengthEncodingScheme.

◆ reset()

virtual void Rose::BinaryAnalysis::Strings::BasicLengthEncodingScheme::reset ( )
overridevirtual

Reset the decoder state machine.

Implements Rose::BinaryAnalysis::Strings::LengthEncodingScheme.


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