Pretty printer of data.
More...
#include <PrettyPrinter.h>
|
std::string | getPrettyRepr (std::shared_ptr< BItem > data, const std::string &indent=" ") |
| Returns a pretty representation of data. More...
|
|
Pretty printer of data.
Can format data in a readable way.
Use create() to create instances.
◆ PrettyPrinter()
bencoding::PrettyPrinter::PrettyPrinter |
( |
| ) |
|
|
privatedefault |
◆ create()
std::unique_ptr< PrettyPrinter > bencoding::PrettyPrinter::create |
( |
| ) |
|
|
static |
◆ decreaseIndentLevel()
void bencoding::PrettyPrinter::decreaseIndentLevel |
( |
| ) |
|
|
private |
Decreases the current indentation by a single level.
◆ getPrettyRepr()
std::string bencoding::PrettyPrinter::getPrettyRepr |
( |
std::shared_ptr< BItem > |
data, |
|
|
const std::string & |
indent = " " |
|
) |
| |
Returns a pretty representation of data.
- Parameters
-
[in] | data | Data to return a pretty representation for. |
[in] | indent | A single level of indentation. |
◆ increaseIndentLevel()
void bencoding::PrettyPrinter::increaseIndentLevel |
( |
| ) |
|
|
private |
Increases the current indentation by a single level.
◆ storeCurrentIndent()
void bencoding::PrettyPrinter::storeCurrentIndent |
( |
| ) |
|
|
private |
Stores the current indentation into prettyRepr
.
◆ visit() [1/4]
void bencoding::PrettyPrinter::visit |
( |
BDictionary * |
bDictionary | ) |
|
|
overrideprivatevirtual |
◆ visit() [2/4]
void bencoding::PrettyPrinter::visit |
( |
BInteger * |
bInteger | ) |
|
|
overrideprivatevirtual |
◆ visit() [3/4]
void bencoding::PrettyPrinter::visit |
( |
BList * |
bList | ) |
|
|
overrideprivatevirtual |
◆ visit() [4/4]
void bencoding::PrettyPrinter::visit |
( |
BString * |
bString | ) |
|
|
overrideprivatevirtual |
◆ currentIndent
std::string bencoding::PrettyPrinter::currentIndent = "" |
|
private |
The current level of indentation.
◆ indentLevel
std::string bencoding::PrettyPrinter::indentLevel = " " |
|
private |
A single level of indentation.
◆ prettyRepr
std::string bencoding::PrettyPrinter::prettyRepr = "" |
|
private |
Pretty representation of the data obtained so far.
The documentation for this class was generated from the following files: