opendnp3
3.1.0
Reference implementation of DNP3 (IEEE-1815)
|
A base-class for bitstrings containing up to 255 bytes. More...
#include <opendnp3/app/OctetData.h>
Public Member Functions | |
OctetData () | |
Construct with a default value of [0x00] (length == 1) More... | |
OctetData (const Buffer &input) | |
Construct from read-only buffer slice. More... | |
OctetData (const char *input) | |
Construct from a c-style string. More... | |
bool | Set (const Buffer &input) |
Set the octet data to the input buffer. More... | |
bool | Set (const char *input) |
Set the buffer equal to the supplied c-string. More... | |
uint8_t | Size () const |
const Buffer | ToBuffer () const |
Static Public Attributes | |
const static uint8_t | MAX_SIZE = 255 |
Static Private Member Functions | |
static const Buffer | ToSlice (const char *input) |
Private Attributes | |
std::array< uint8_t, MAX_SIZE > | buffer = {0x00} |
uint8_t | size |
A base-class for bitstrings containing up to 255 bytes.
Definition at line 34 of file OctetData.h.
opendnp3::OctetData::OctetData | ( | ) |
Construct with a default value of [0x00] (length == 1)
opendnp3::OctetData::OctetData | ( | const char * | input | ) |
Construct from a c-style string.
strlen() is used internally to determine the length
If the length is 0, the default value of [0x00] is assigned If the length is > 255, only the first 255 bytes are copied.
The null terminator is NOT copied as part of buffer
opendnp3::OctetData::OctetData | ( | const Buffer & | input | ) |
Construct from read-only buffer slice.
If the length is 0, the default value of [0x00] is assigned If the length is > 255, only the first 255 bytes are copied.
The null terminator is NOT copied as part of buffer
Set the octet data to the input buffer.
If the length is 0, the default value of [0x00] is assigned If the length is > 255, only the first 255 bytes are copied
input | the input data to copy into this object |
bool opendnp3::OctetData::Set | ( | const char * | input | ) |
Set the buffer equal to the supplied c-string.
If the length is 0, the default value of [0x00] is assigned If the length is > 255, only the first 255 bytes are copied
input | c-style string to copy into this object |
|
inline |
Definition at line 67 of file OctetData.h.
References size.
const Buffer opendnp3::OctetData::ToBuffer | ( | ) | const |
|
staticprivate |
|
private |
Definition at line 104 of file OctetData.h.
|
static |
Definition at line 37 of file OctetData.h.
|
private |
Definition at line 105 of file OctetData.h.
Referenced by Size().