2015-02-05 21:57:04 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
#include <list>
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
class TLVNode {
|
|
|
|
|
public:
|
|
|
|
|
TLVNode(const uint16_t type);
|
|
|
|
|
TLVNode(const uint16_t type, const std::string value);
|
|
|
|
|
|
|
|
|
|
static TLVNode* Decode(const std::string& input);
|
|
|
|
|
void Encode(std::string *output);
|
|
|
|
|
|
2015-02-06 16:27:47 +00:00
|
|
|
bool IsContainer();
|
|
|
|
|
|
2015-02-05 21:57:04 +00:00
|
|
|
private:
|
|
|
|
|
const uint16_t type_;
|
|
|
|
|
const std::string value_;
|
|
|
|
|
std::list<TLVNode> children_;
|
|
|
|
|
};
|