8 #ifndef BENCODING_PRETTYPRINTER_H 9 #define BENCODING_PRETTYPRINTER_H 29 static std::unique_ptr<PrettyPrinter>
create();
32 const std::string &indent =
" ");
66 const std::string &indent =
" ");
Representation of an integer.
Definition: BInteger.h:23
static std::unique_ptr< PrettyPrinter > create()
Creates a new printer.
Definition: PrettyPrinter.cpp:26
virtual void visit(BDictionary *bDictionary) override
Definition: PrettyPrinter.cpp:67
Base class for all visitors of the BItem subclasses.
std::string getPrettyRepr(std::shared_ptr< BItem > data, const std::string &indent=" ")
Returns a pretty representation of data.
Definition: PrettyPrinter.cpp:154
Base class for all visitors of the BItem subclasses.
Definition: BItemVisitor.h:25
Representation of a dictionary.
Definition: BDictionary.h:39
void decreaseIndentLevel()
Decreases the current indentation by a single level.
Definition: PrettyPrinter.cpp:62
void increaseIndentLevel()
Increases the current indentation by a single level.
Definition: PrettyPrinter.cpp:55
std::string prettyRepr
Pretty representation of the data obtained so far.
Definition: PrettyPrinter.h:54
Pretty printer of data.
Definition: PrettyPrinter.h:27
std::string currentIndent
The current level of indentation.
Definition: PrettyPrinter.h:60
std::string getPrettyRepr(std::shared_ptr< BItem > data, const std::string &indent=" ")
Returns a pretty representation of data.
Definition: PrettyPrinter.cpp:36
Main namespace of the bencoding library.
std::string indentLevel
A single level of indentation.
Definition: PrettyPrinter.h:57
void storeCurrentIndent()
Stores the current indentation into prettyRepr.
Definition: PrettyPrinter.cpp:48
Representation of a string.
Definition: BString.h:23
Representation of a list.
Definition: BList.h:26
PrettyPrinter()
Constructs a printer.