Go to the documentation of this file.
17 [[nodiscard]]
virtual std::string
to_string()
const = 0;
30 [[nodiscard]] std::string
to_string()
const override;
33 [[nodiscard]] int64_t
value()
const;
43 [[nodiscard]] std::string
to_string()
const override;
46 [[nodiscard]] std::string&
value();
52 std::vector<std::unique_ptr<BencodeValue>> _val;
55 explicit BencodeList(std::vector<std::unique_ptr<BencodeValue>> data);
56 [[nodiscard]] std::string
to_string()
const override;
59 [[nodiscard]] std::vector<std::unique_ptr<BencodeValue>>&
value();
65 std::map<std::string, std::unique_ptr<BencodeValue>> _val;
70 std::map<std::string, std::unique_ptr<BencodeValue>> data);
71 [[nodiscard]] std::string
to_string()
const override;
75 [[nodiscard]] std::map<std::string, std::unique_ptr<BencodeValue>>&
value();
std::string to_string() const override
Returns the string representation of the bencode value.
Definition: bencode_value.cpp:67
std::vector< std::unique_ptr< BencodeValue > > & value()
Returns the list of BencodeValue objects that are contained in the list.
Definition: bencode_value.cpp:56
BencodeType
Enumeration for the different types of bencode data.
Definition: bencode_value.hpp:12
Contains the structure for decoding and encoding bencode data.
Definition: bencode_parser.cpp:7
std::string & value()
Returns the string value of the bencode value.
Definition: bencode_value.cpp:35
virtual ~BencodeValue()=default
int64_t value() const
Returns the integer value of the bencode value.
Definition: bencode_value.cpp:21
virtual BencodeType get_type() const =0
Returns the type of the bencode value as a BencodeType enum.
BencodeType get_type() const override
Returns the type of the bencode value as a BencodeType enum.
Definition: bencode_value.cpp:33
BencodeType get_type() const override
Returns the type of the bencode value as a BencodeType enum.
Definition: bencode_value.cpp:19
std::map< std::string, std::unique_ptr< BencodeValue > > & value()
Definition: bencode_value.cpp:82
BencodeDict(std::map< std::string, std::unique_ptr< BencodeValue >> data)
Constructs a BencodeDict object from a map of strings and BencodeValue.
Definition: bencode_value.cpp:63
BencodeInt(int64_t data)
Definition: bencode_value.cpp:12
BencodeType get_type() const override
Returns the type of the bencode value as a BencodeType enum.
Definition: bencode_value.cpp:80
BencodeList(std::vector< std::unique_ptr< BencodeValue >> data)
Definition: bencode_value.cpp:40
Definition: bencode_value.hpp:36
BencodeString(std::string data)
Definition: bencode_value.cpp:26
std::string to_string() const override
Returns the string representation of the bencode value.
Definition: bencode_value.cpp:28
Definition: bencode_value.hpp:23
Definition: bencode_value.hpp:62
Definition: bencode_value.hpp:14
std::string to_string() const override
Returns the string representation of the bencode value.
Definition: bencode_value.cpp:44
std::string to_string() const override
Returns the string representation of the bencode value.
Definition: bencode_value.cpp:14
virtual std::string to_string() const =0
Returns the string representation of the bencode value.
Definition: bencode_value.hpp:49
BencodeType get_type() const override
Returns the type of the bencode value as a BencodeType enum.
Definition: bencode_value.cpp:54