rotate  1.0
Bit rotator
HexString Class Reference

#include <HexString.h>

Inheritance diagram for HexString:
Collaboration diagram for HexString:

Public Member Functions

 HexString (std::string str)
 
 HexString (const char *str)
 Construct a new HexString object In order to do this we first need to parse the hex string. If this is not in the correct format, the we need to raise an exception and bail. More...
 
virtual ~HexString ()
 Destroy the HexString object. Before we leave we need to zero out all memory that has been used. std::string only guareties that the memory will be reclaimed. Not that it will be whiped. More...
 
virtual void init ()
 The initialisation frunction parses the hex string then creates a vector uint8_t values to create an instance of ArrayBuff. We use new, rather than std::shared_ptr so that we can closely control when it is destroyed, thereby cleaning up the memory used to store values. More...
 
virtual uint8_t get_next_byte ()
 Fulfil the interface by calling ArrayBuff to get the next byte. More...
 
virtual void write_next_byte (uint8_t byte)
 Fulfill the interface by calling ArrayBuff to write the next byte. More...
 
virtual void write_first_byte (uint8_t byte)
 Fulfill the interface by calling ArrayBuff tp write the first byte. More...
 
virtual unsigned int get_length ()
 Fulfill the interface by calling ArrayBuff to get the length of the buffer. More...
 
virtual bool end ()
 Fulfill the interface by calling ArrayBuff to tell if its the end of the buffer. More...
 
virtual void rotate_left ()
 While this looks counter intuative, Base::rotate_left() will call the functions implement in this class, which wil. route the calls to the correct place, in this instance m_arr (the ArrayBuff object) More...
 
virtual void rotate_right ()
 Route the call to Base so that calls routed above are called correctly. See comment for previous function. More...
 
uint8_t get_rotate_byte ()
 
void reset ()
 
std::string render ()
 Render the rotated result back into a string. More...
 
ArrayBuffget_array_buff ()
 
- Public Member Functions inherited from Base
virtual ~Base ()
 

Detailed Description

Definition at line 25 of file HexString.h.

Constructor & Destructor Documentation

◆ HexString() [1/2]

HexString ( std::string  str)

Definition at line 25 of file HexString.cpp.

◆ HexString() [2/2]

HexString ( const char *  hex)

Construct a new HexString object In order to do this we first need to parse the hex string. If this is not in the correct format, the we need to raise an exception and bail.

Parameters
hexShoud be a string in the format '0xNN','0xNN',...,'0xNN' where NN is a valid hexidecimal numbe.

Definition at line 18 of file HexString.cpp.

◆ ~HexString()

~HexString ( )
virtual

Destroy the HexString object. Before we leave we need to zero out all memory that has been used. std::string only guareties that the memory will be reclaimed. Not that it will be whiped.

Definition at line 39 of file HexString.cpp.

Member Function Documentation

◆ end()

bool end ( )
virtual

Fulfill the interface by calling ArrayBuff to tell if its the end of the buffer.

Returns
true
false

Implements Base.

Definition at line 122 of file HexString.cpp.

Here is the call graph for this function:

◆ get_array_buff()

ArrayBuff* get_array_buff ( )
inline

Definition at line 51 of file HexString.h.

◆ get_length()

unsigned int get_length ( )
virtual

Fulfill the interface by calling ArrayBuff to get the length of the buffer.

Returns
unsigned int

Implements Base.

Definition at line 112 of file HexString.cpp.

Here is the call graph for this function:

◆ get_next_byte()

uint8_t get_next_byte ( )
virtual

Fulfil the interface by calling ArrayBuff to get the next byte.

Returns
uint8_t

Implements Base.

Definition at line 84 of file HexString.cpp.

Here is the call graph for this function:

◆ get_rotate_byte()

uint8_t get_rotate_byte ( )
inline

Definition at line 41 of file HexString.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init()

void init ( )
virtual

The initialisation frunction parses the hex string then creates a vector uint8_t values to create an instance of ArrayBuff. We use new, rather than std::shared_ptr so that we can closely control when it is destroyed, thereby cleaning up the memory used to store values.

Implements Base.

Definition at line 53 of file HexString.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render()

std::string render ( )

Render the rotated result back into a string.

Returns
std::string

Definition at line 151 of file HexString.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

void reset ( )
inline

Definition at line 45 of file HexString.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rotate_left()

void rotate_left ( )
virtual

While this looks counter intuative, Base::rotate_left() will call the functions implement in this class, which wil. route the calls to the correct place, in this instance m_arr (the ArrayBuff object)

Reimplemented from Base.

Definition at line 132 of file HexString.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rotate_right()

void rotate_right ( )
virtual

Route the call to Base so that calls routed above are called correctly. See comment for previous function.

Reimplemented from Base.

Definition at line 141 of file HexString.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_first_byte()

void write_first_byte ( uint8_t  byte)
virtual

Fulfill the interface by calling ArrayBuff tp write the first byte.

Parameters
byte

Implements Base.

Definition at line 103 of file HexString.cpp.

Here is the call graph for this function:

◆ write_next_byte()

void write_next_byte ( uint8_t  byte)
virtual

Fulfill the interface by calling ArrayBuff to write the next byte.

Parameters
byte

Implements Base.

Definition at line 94 of file HexString.cpp.

Here is the call graph for this function:

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