Dangerous SNMP
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Encoder Class Reference

This class is a "helper" class that takes some kind of thing and returns a standard string that represents its BER encoding. More...

#include <encoder.hpp>

Static Public Member Functions

template<typename EncodingClass >
static std::string encodeToString (typename EncodingClass::value_type &value)
 This BER-encodes a value and returns a standard string of the result. More...
 
template<typename EncodingClass >
static std::vector< char > encodeToVector (typename EncodingClass::value_type &value)
 This BER-encodes a value and returns a standard vector of the result. More...
 

Detailed Description

This class is a "helper" class that takes some kind of thing and returns a standard string that represents its BER encoding.

Since we do this by setting up a ByteStream and doing the work there, it ends up being a hassle to actually do this over and over again.

Member Function Documentation

static std::string encodeToString ( typename EncodingClass::value_type &  value)
inlinestatic

This BER-encodes a value and returns a standard string of the result.

The encoder class.

Parameters
valueThe value to encode.
Returns
A string with the encoded data.

This byte stream will be used to write (that is, "encode") the value that we have been given.

This is the string that we'll be returning. We're going to copy the encoded data into this string.

static std::vector<char> encodeToVector ( typename EncodingClass::value_type &  value)
inlinestatic

This BER-encodes a value and returns a standard vector of the result.

The encoder class.

Parameters
valueThe value to encode.
Returns
A vector with the encoded data.

This byte stream will be used to write (that is, "encode") the value that we have been given.

This is the string that we'll be returning. We're going to copy the encoded data into this string.


The documentation for this class was generated from the following file: