ROSE  0.9.9.139
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 447 of file BinaryString.h.

#include <BinaryString.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 ROSE_OVERRIDE
 Create a new copy of this encoder. More...
 
virtual std::string name () const ROSE_OVERRIDE
 Name of encoder. More...
 
virtual Octets encode (size_t) ROSE_OVERRIDE
 Encode a length into a sequence of octets. More...
 
virtual State decode (Octet) ROSE_OVERRIDE
 Decode one octet. More...
 
virtual size_t consume () ROSE_OVERRIDE
 Consume a decoded length. More...
 
virtual void reset () ROSE_OVERRIDE
 Reset the decoder state machine. More...
 
- Public Member Functions inherited from Rose::BinaryAnalysis::Strings::LengthEncodingScheme
State state () const
 Decoder state. 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...
 

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. More...
 
- Protected Attributes inherited from Rose::BinaryAnalysis::Strings::LengthEncodingScheme
State state_
 

Member Function Documentation

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

Create a new copy of this encoder.

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

Definition at line 461 of file BinaryString.h.

virtual std::string Rose::BinaryAnalysis::Strings::BasicLengthEncodingScheme::name ( ) const
virtual
virtual Octets Rose::BinaryAnalysis::Strings::BasicLengthEncodingScheme::encode ( size_t  )
virtual

Encode a length into a sequence of octets.

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

virtual State Rose::BinaryAnalysis::Strings::BasicLengthEncodingScheme::decode ( Octet  )
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.

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

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

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

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

Reset the decoder state machine.

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


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