Represents an Octet String as described in RFC 2741, section 5.3. More...
#include <OctetStringValue.hpp>
Public Member Functions | |
| binary | serialize () const |
| Encode the object as described in RFC 2741, section 5.3. | |
| OctetStringValue (binary initial_value) | |
| Construct object from binary data. | |
| OctetStringValue (std::string initial_value) | |
| Construct object from a string. | |
| OctetStringValue () | |
| Create empty OctetStringValue object. | |
| OctetStringValue (binary::const_iterator &pos, const binary::const_iterator &end, bool big_endian=true) | |
| Parse Constructor. | |
| void | set_value (binary new_value) |
| Set the current value. | |
| void | set_value (std::string new_value) |
| Set the current value. | |
| binary | get_value () const |
| Get the current value. | |
| std::string | str () const |
| Get the current value as string. | |
Public Member Functions inherited from agentxcpp::AbstractValue | |
| virtual | ~AbstractValue () |
| Destructor. | |
Private Attributes | |
| binary | value |
| The string. | |
Represents an Octet String as described in RFC 2741, section 5.3.
Definition at line 31 of file OctetStringValue.hpp.
|
inline |
Construct object from binary data.
Definition at line 55 of file OctetStringValue.hpp.
| OctetStringValue::OctetStringValue | ( | std::string | initial_value | ) |
Construct object from a string.
Definition at line 27 of file OctetStringValue.cpp.
References set_value().
|
inline |
Create empty OctetStringValue object.
Definition at line 65 of file OctetStringValue.hpp.
| OctetStringValue::OctetStringValue | ( | binary::const_iterator & | pos, |
| const binary::const_iterator & | end, | ||
| bool | big_endian = true |
||
| ) |
Parse Constructor.
This constructor parses the serialized form of the object. It takes an iterator, starts parsing at the position of the iterator and advances the iterator to the position right behind the object.
The constructor expects valid data from the stream; if parsing fails, parse_error is thrown. In this case, the iterator position is undefined.
| pos | Iterator pointing to the current stream position. The iterator is advanced while reading the header. |
| end | Iterator pointing one element past the end of the current stream. This is needed to mark the end of the buffer. |
| big_endian | Whether the input stream is in big endian format |
Definition at line 97 of file OctetStringValue.cpp.
References agentxcpp::read32(), and value.
|
inline |
|
virtual |
Encode the object as described in RFC 2741, section 5.3.
Implements agentxcpp::AbstractValue.
Definition at line 75 of file OctetStringValue.cpp.
References value, and agentxcpp::write32().
Referenced by agentxcpp::PDUwithContext::add_header(), agentxcpp::OpenPDU::serialize(), and agentxcpp::AddAgentCapsPDU::serialize().
|
inline |
Set the current value.
Definition at line 98 of file OctetStringValue.hpp.
References value.
Referenced by OctetStringValue().
| void OctetStringValue::set_value | ( | std::string | new_value | ) |
| std::string OctetStringValue::str | ( | ) | const |
Get the current value as string.
Definition at line 53 of file OctetStringValue.cpp.
References value.
|
private |
The string.
According to RFC 2578, Octet_String represents arbitrary binary or textual data.
Definition at line 40 of file OctetStringValue.hpp.
Referenced by get_value(), OctetStringValue(), serialize(), set_value(), and str().