Represents a bencoded value which can be: More...
#include <bencode.h>
Public Types | |
| enum class | Type { Integer , String , List , Dictionary } |
Public Member Functions | |
| BencodeValue () | |
| BencodeValue (int64_t value) | |
| BencodeValue (const std::string &value) | |
| BencodeValue (const char *value) | |
| BencodeValue (const BencodeList &value) | |
| BencodeValue (const BencodeDict &value) | |
| BencodeValue (const BencodeValue &other) | |
| BencodeValue (BencodeValue &&other) noexcept | |
| BencodeValue & | operator= (const BencodeValue &other) |
| BencodeValue & | operator= (BencodeValue &&other) noexcept |
| ~BencodeValue () | |
| Type | get_type () const |
| bool | is_integer () const |
| bool | is_string () const |
| bool | is_list () const |
| bool | is_dict () const |
| int64_t | as_integer () const |
| const std::string & | as_string () const |
| const BencodeList & | as_list () const |
| const BencodeDict & | as_dict () const |
| BencodeList & | as_list () |
| BencodeDict & | as_dict () |
| bool | has_key (const std::string &key) const |
| const BencodeValue & | operator[] (const std::string &key) const |
| BencodeValue & | operator[] (const std::string &key) |
| const BencodeValue & | operator[] (size_t index) const |
| BencodeValue & | operator[] (size_t index) |
| void | push_back (const BencodeValue &value) |
| size_t | size () const |
| std::vector< uint8_t > | encode () const |
| std::string | encode_string () const |
Static Public Member Functions | |
| static BencodeValue | create_integer (int64_t value) |
| static BencodeValue | create_string (const std::string &value) |
| static BencodeValue | create_list () |
| static BencodeValue | create_dict () |
Represents a bencoded value which can be:
|
strong |
| librats::BencodeValue::BencodeValue | ( | ) |
| librats::BencodeValue::BencodeValue | ( | int64_t | value | ) |
| librats::BencodeValue::BencodeValue | ( | const std::string & | value | ) |
| librats::BencodeValue::BencodeValue | ( | const char * | value | ) |
| librats::BencodeValue::BencodeValue | ( | const BencodeList & | value | ) |
| librats::BencodeValue::BencodeValue | ( | const BencodeDict & | value | ) |
| librats::BencodeValue::BencodeValue | ( | const BencodeValue & | other | ) |
|
noexcept |
| librats::BencodeValue::~BencodeValue | ( | ) |
| BencodeDict & librats::BencodeValue::as_dict | ( | ) |
| const BencodeDict & librats::BencodeValue::as_dict | ( | ) | const |
| int64_t librats::BencodeValue::as_integer | ( | ) | const |
| BencodeList & librats::BencodeValue::as_list | ( | ) |
| const BencodeList & librats::BencodeValue::as_list | ( | ) | const |
| const std::string & librats::BencodeValue::as_string | ( | ) | const |
|
static |
|
static |
|
static |
|
static |
| std::vector< uint8_t > librats::BencodeValue::encode | ( | ) | const |
| std::string librats::BencodeValue::encode_string | ( | ) | const |
| bool librats::BencodeValue::has_key | ( | const std::string & | key | ) | const |
|
inline |
Definition at line 63 of file bencode.h.
References Dictionary.
|
inline |
|
inline |
|
inline |
|
noexcept |
| BencodeValue & librats::BencodeValue::operator= | ( | const BencodeValue & | other | ) |
| BencodeValue & librats::BencodeValue::operator[] | ( | const std::string & | key | ) |
| const BencodeValue & librats::BencodeValue::operator[] | ( | const std::string & | key | ) | const |
| BencodeValue & librats::BencodeValue::operator[] | ( | size_t | index | ) |
| const BencodeValue & librats::BencodeValue::operator[] | ( | size_t | index | ) | const |
| void librats::BencodeValue::push_back | ( | const BencodeValue & | value | ) |
| size_t librats::BencodeValue::size | ( | ) | const |