|
cpp-bencoding
|
Representation of a string. More...
#include <BString.h>
Public Types | |
| using | ValueType = std::string |
| Type of the underlying string value. More... | |
Public Member Functions | |
| ValueType | value () const |
| Returns the string's value. More... | |
| void | setValue (ValueType value) |
| Sets a new value. More... | |
| ValueType::size_type | length () const |
| Returns the number of characters in the string. More... | |
BItemVisitor Support | |
| virtual void | accept (BItemVisitor *visitor) override |
| Accepts the item by the given visitor. More... | |
Public Member Functions inherited from bencoding::BItem | |
| virtual | ~BItem ()=0 |
| Destructs the item. More... | |
| template<typename T > | |
| std::shared_ptr< T > | as () |
| Casts the item to the given subclass of BItem. More... | |
Static Public Member Functions | |
| static std::unique_ptr< BString > | create (ValueType value) |
| Creates and returns a new string. More... | |
Private Member Functions | |
| BString (ValueType value) | |
| Constructs the string with the given value. More... | |
Private Attributes | |
| ValueType | _value |
Additional Inherited Members | |
Protected Member Functions inherited from bencoding::BItem | |
| BItem () | |
| Constructs the item. More... | |
Representation of a string.
Use create() to create instances of the class.
| using bencoding::BString::ValueType = std::string |
Type of the underlying string value.
|
explicitprivate |
Constructs the string with the given value.
|
overridevirtual |
Accepts the item by the given visitor.
Subclasses should implement this function in this way:
Implements bencoding::BItem.
Creates and returns a new string.
| auto bencoding::BString::length | ( | ) | const |
Returns the number of characters in the string.
| void bencoding::BString::setValue | ( | ValueType | value | ) |
Sets a new value.
| auto bencoding::BString::value | ( | ) | const |
Returns the string's value.
|
private |
1.8.14