libxcks
0.1.0.1
|
Stores the value of a checksum. More...
#include <ckvalue.hpp>
Public Member Functions | |
ChecksumValue () | |
Default constructor. More... | |
ChecksumValue (const uint8_t *value, const size_t size, const ChecksumAlgoId type) | |
Constructor with a checksum's value. More... | |
ChecksumValue (const std::string &strValue, const ChecksumAlgoId type) | |
Constructor with a checksum's value. More... | |
ChecksumValue (const Checksum &checksum) | |
Constructor from a checksum's value. More... | |
ChecksumValue (const ChecksumValue &source) | |
Copy constructor. More... | |
ChecksumValue (ChecksumValue &&rhs) | |
Move constructor. More... | |
ChecksumValue & | operator= (const ChecksumValue &source) |
Assignment operator. More... | |
ChecksumValue & | operator= (ChecksumValue &&rhs) |
Move assignment operator. More... | |
virtual | ~ChecksumValue () |
Destructor. More... | |
bool | operator== (const ChecksumValue &cmp) const |
Tests if two checksum's values are equals. More... | |
bool | operator!= (const ChecksumValue &cmp) const |
Tests if two checksum's values are differents. More... | |
int | compare (const ChecksumValue &cmp) const |
Compares this value with the value of another checksum. More... | |
const uint8_t * | getValue () const |
Gets the value of the checksum. More... | |
bool | getValue (uint8_t *value, const size_t size) const |
Gets the value of the checksum. More... | |
void | setValue (const uint8_t *value, const size_t size, const ChecksumAlgoId type) |
Sets the value of the checksum. More... | |
void | setValue (const std::string &strValue, const ChecksumAlgoId type) |
Sets the value of the checksum. More... | |
size_t | getSize () const |
Gets the size of the checksum's value. More... | |
ChecksumAlgoId | getType () const |
Gets the type of the checksum. More... | |
Protected Member Functions | |
void | clone (const ChecksumValue &source) |
Clones the source instance in this instance. More... | |
Protected Attributes | |
uint8_t * | value |
Value of the checksum. More... | |
size_t | valueSize |
Size of the checksum's value. More... | |
ChecksumAlgoId | type |
Type of the checksum. More... | |
Stores the value of a checksum.
This class supports comparison and assignment operations.
Definition at line 44 of file ckvalue.hpp.
libxcks::ChecksumValue::ChecksumValue | ( | ) |
Default constructor.
Definition at line 47 of file ckvalue.cpp.
libxcks::ChecksumValue::ChecksumValue | ( | const uint8_t * | value, |
const size_t | size, | ||
const ChecksumAlgoId | type | ||
) |
Constructor with a checksum's value.
value | Value of the checksum. |
size | Size of the checksum' value. |
type | Type of the checksum. |
Definition at line 135 of file ckvalue.cpp.
libxcks::ChecksumValue::ChecksumValue | ( | const std::string & | strValue, |
const ChecksumAlgoId | type | ||
) |
Constructor with a checksum's value.
The provided string must be compliant with the following regular expression: (([a-fA-F0-9]){2}\s?)*(([a-fA-F0-9]){2})
. If a parsing error occurs, an empty value is set.
strValue | New value of the checksum. |
type | Type of the new checksum's value. |
Definition at line 153 of file ckvalue.cpp.
libxcks::ChecksumValue::ChecksumValue | ( | const Checksum & | checksum | ) |
Constructor from a checksum's value.
checksum | Checksum from which the values are taken. |
Definition at line 166 of file ckvalue.cpp.
libxcks::ChecksumValue::ChecksumValue | ( | const ChecksumValue & | source | ) |
libxcks::ChecksumValue::ChecksumValue | ( | ChecksumValue && | rhs | ) |
Move constructor.
rhs | The right hand side instance. |
Definition at line 86 of file ckvalue.cpp.
|
virtual |
Destructor.
Definition at line 187 of file ckvalue.cpp.
|
protected |
Clones the source instance in this instance.
source | Source instance. |
Definition at line 61 of file ckvalue.cpp.
int libxcks::ChecksumValue::compare | ( | const ChecksumValue & | cmp | ) | const |
Compares this value with the value of another checksum.
cmp | Checksum's value to compare with this checksum's value. |
Definition at line 244 of file ckvalue.cpp.
size_t libxcks::ChecksumValue::getSize | ( | ) | const |
Gets the size of the checksum's value.
Definition at line 424 of file ckvalue.cpp.
ChecksumAlgoId libxcks::ChecksumValue::getType | ( | ) | const |
Gets the type of the checksum.
Definition at line 436 of file ckvalue.cpp.
const uint8_t * libxcks::ChecksumValue::getValue | ( | ) | const |
Gets the value of the checksum.
delete[]
on the returned value. So don't use the returned value outside the lifetime of this ChecksumValue's instance. Definition at line 270 of file ckvalue.cpp.
bool libxcks::ChecksumValue::getValue | ( | uint8_t * | value, |
const size_t | size | ||
) | const |
Gets the value of the checksum.
value | The buffer that will contain the value of checksum. |
size | Size of the buffer that will contain the value of checksum. |
true
if the buffer is big enough to store the checksum's value, false
if not (in this case, the checksums' value is not copied). Definition at line 287 of file ckvalue.cpp.
bool libxcks::ChecksumValue::operator!= | ( | const ChecksumValue & | cmp | ) | const |
Tests if two checksum's values are differents.
cmp | Checksum's value to compare with this checksum's value. |
true
if one or more of the value, the size or the type of the two checksums are differents, false
otherwise. Definition at line 228 of file ckvalue.cpp.
ChecksumValue & libxcks::ChecksumValue::operator= | ( | ChecksumValue && | rhs | ) |
Move assignment operator.
rhs | The right hand side instance. |
Definition at line 113 of file ckvalue.cpp.
ChecksumValue & libxcks::ChecksumValue::operator= | ( | const ChecksumValue & | source | ) |
Assignment operator.
source | Source instance. |
Definition at line 100 of file ckvalue.cpp.
bool libxcks::ChecksumValue::operator== | ( | const ChecksumValue & | cmp | ) | const |
Tests if two checksum's values are equals.
cmp | Checksum's value to compare with this checksum's value. |
true
if the value, the size and the type of the two checksums are strictly equals, false
otherwise. Definition at line 202 of file ckvalue.cpp.
void libxcks::ChecksumValue::setValue | ( | const std::string & | strValue, |
const ChecksumAlgoId | type | ||
) |
Sets the value of the checksum.
The provided string must be compliant with the following regular expression: (([a-fA-F0-9]){2}\s?)*(([a-fA-F0-9]){2})
. If a parsing error occurs, an empty value is set.
strValue | New value of the checksum. |
type | Type of the new checksum's value. |
Definition at line 349 of file ckvalue.cpp.
void libxcks::ChecksumValue::setValue | ( | const uint8_t * | value, |
const size_t | size, | ||
const ChecksumAlgoId | type | ||
) |
Sets the value of the checksum.
value | New value of the checksum. Can be nullptr . |
size | Size of the new checksum's value. |
type | Type of the new checksum's value. |
Definition at line 305 of file ckvalue.cpp.
|
protected |
Type of the checksum.
Definition at line 49 of file ckvalue.hpp.
|
protected |
Value of the checksum.
Definition at line 47 of file ckvalue.hpp.
|
protected |
Size of the checksum's value.
Definition at line 48 of file ckvalue.hpp.