 |
Kea
1.5.0
|
Go to the documentation of this file.
15 : length_field_type_(length_field_type) {
22 append(&text[0], text.size());
32 assign(&text[0], text.size());
49 return (std::string(data_.begin(), data_.end()));
56 " opaque data field, because the field appears to be empty");
59 " opaque data field, because current data length "
60 <<
getLength() <<
" exceeds the maximum size for the length"
81 assign(&other[0], other.length());
106 is.read(buf,
sizeof(buf));
109 tuple.
append(buf, is.gcount());
size_t getLength() const
Returns the length of the data in the tuple.
std::string getText() const
Return the tuple data in the textual format.
bool equals(const std::string &other) const
Checks if the data carried in the tuple match the string.
void append(InputIterator data, const size_t len)
Appends data to the tuple.
void writeUint16(uint16_t data)
Write an unsigned 16-bit integer in host byte order into the buffer in network byte order.
bool operator!=(const std::string &other)
Inequality operator.
LengthFieldType
Size of the length field in the tuple.
OpaqueDataTuple & operator=(const std::string &other)
Assignment operator.
Defines the logger used by the top-level component of kea-dhcp-ddns.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
void assign(InputIterator data, const size_t len)
Assigns data to the tuple.
Exception to be thrown when the operation on OpaqueDataTuple object results in an error.
void writeUint8(uint8_t data)
Write an unsigned 8-bit integer into the buffer.
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
bool operator==(const std::string &other) const
Equality operator.
int getDataFieldSize() const
Returns the size of the tuple length field.
Represents a single instance of the opaque data preceded by length.
void pack(isc::util::OutputBuffer &buf) const
Renders the tuple to a buffer in the wire format.
void writeData(const void *data, size_t len)
Copy an arbitrary length of data into the buffer.
std::istream & operator>>(std::istream &is, OpaqueDataTuple &tuple)
Inserts data carried in the stream into the tuple.
std::ostream & operator<<(std::ostream &os, const OpaqueDataTuple &tuple)
Inserts the OpaqueDataTuple as a string into stream.
OpaqueDataTuple(LengthFieldType length_field_type)
Default constructor.
const Buffer & getData() const
Returns a reference to the buffer holding tuple data.
void clear()
Removes the contents of the tuple.