A class representing a block of raw memory.
More...
#include <MemoryBlock.h++>
A class representing a block of raw memory.
- Author
- Mark Lindner
◆ MemoryBlock()
Construct a MemoryBlock for the given raw data.
The class does not take ownership of the data.
- Parameters
-
data | A pointer to the data. |
length | The length of the data. |
◆ ~MemoryBlock()
◆ data()
Returns a pointer to the data.
◆ find()
int find |
( |
uchar * |
sequence, |
|
|
uint |
sequenceLength |
|
) |
| const |
Searches for the first occurrence of a sequence of bytes in the data.
- Parameters
-
sequence | The sequence to search for. |
sequenceLength | The length of the sequence. |
- Returns
- The offset of the first occurrence of the sequence, or -1 if the sequence was not found within the block.
◆ findLast()
int findLast |
( |
uchar * |
sequence, |
|
|
uint |
sequenceLength |
|
) |
| const |
Searches for the last occurrence of a sequence of bytes in the data.
- Parameters
-
sequence | The sequence to search for. |
sequenceLength | The length of the sequence. |
- Returns
- The offset of the last occurrence of the sequence, or -1 if the sequence was not found within the block.
◆ length()
Returns the length of the data.
◆ setData()
void setData |
( |
uchar * |
data | ) |
|
|
inline |
Sets the pointer to the data.
◆ setLength()
void setLength |
( |
uint |
length | ) |
|
|
inline |
Sets the length of the data.
The documentation for this class was generated from the following file: