MongoType
MongoDB Collection Data Dump with BSON Types
|
Human readable BSON Object Dump. More...
#include <BSONObjectTypeDump.hpp>
Human readable BSON Object Dump.
Provides an std::ostream comparable output operator for dumping a human readable text version of the given BSON object. BSONObjectTypeDump implements interface IBSONObjectVisitor and uses the BSON object parsing events to output the BSON object's text representation.
Definition at line 51 of file BSONObjectTypeDump.hpp.
Public Member Functions | |
BSONObjectTypeDump (Parameters &pparams, string &pinitialToken, const char *pindentStr=" ") | |
Construct a BSON object dumper. More... | |
virtual | ~BSONObjectTypeDump () |
virtual void | setOutputStream (std::ostream &os) |
virtual void | begin (const char *prefix) |
virtual void | end (const char *suffix) |
virtual void | render (const BSONObj &object, int docIndex, int docCount) |
![]() | |
virtual | ~IBSONRenderer () |
Protected Member Functions | |
virtual void | onParseStart () |
Parser Construction Event. More... | |
virtual void | onParseEnd () |
Parser Destruction Event. More... | |
virtual void | onObjectStart (const BSONParserStack &stack) |
BSON Object Precursor Event. More... | |
virtual void | onObjectEnd (const BSONParserStack &stack) |
BSON Object Successor Event. More... | |
virtual void | onArrayStart (const BSONParserStack &stack) |
BSON Array Precursor Event. More... | |
virtual void | onArrayEnd (const BSONParserStack &stack) |
BSON Array Successor Event. More... | |
virtual void | onElement (const BSONParserStack &stack) |
BSON Element Event. More... | |
![]() | |
virtual | ~IBSONObjectVisitor () |
Private Member Functions | |
string | istr () |
Private Attributes | |
Parameters & | params |
string | indentStr |
string | initialToken |
int | level |
function< ostream &()> | getOStream |
|
inline |
Construct a BSON object dumper.
[in] | pparams | The command line parameters. |
[in] | pinitialToken | The string the prefixes all output lines. |
[in] | pindentStr | The string used to indent the text output. The indent text is prepended to the output lines once for each indent level. |
Definition at line 112 of file BSONObjectTypeDump.hpp.
|
inlinevirtual |
Definition at line 115 of file BSONObjectTypeDump.hpp.
|
inlinevirtual |
Implements mongotype::IBSONRenderer.
Definition at line 127 of file BSONObjectTypeDump.hpp.
References getOStream.
|
inlinevirtual |
Implements mongotype::IBSONRenderer.
Definition at line 136 of file BSONObjectTypeDump.hpp.
References getOStream.
|
inlineprivate |
Definition at line 58 of file BSONObjectTypeDump.hpp.
References indentStr, and level.
Referenced by onElement(), onObjectEnd(), and onObjectStart().
|
inlineprotectedvirtual |
BSON Array Successor Event.
[in] | stack | The BSONParserStack object containing the current parse context. |
Invoked once per each non-terminal BSON array after parsing the contained BSON elements.
Implements mongotype::IBSONObjectVisitor.
Definition at line 94 of file BSONObjectTypeDump.hpp.
References level.
|
inlineprotectedvirtual |
BSON Array Precursor Event.
[in] | stack | The BSONParserStack object containing the current parse context. |
Invoked once per each non-terminal BSON array before parsing the contained BSON elements.
Implements mongotype::IBSONObjectVisitor.
Definition at line 89 of file BSONObjectTypeDump.hpp.
References mongotype::BSONParserStackItem::getArrayCount(), getOStream, level, and mongotype::BSONParserStack::top().
|
inlineprotectedvirtual |
BSON Element Event.
[in] | stack | The BSONParserStack object containing the current parse context. |
Invoked once per each terminal BSON element that is not a BSON object or a BSON array.
Implements mongotype::IBSONObjectVisitor.
Definition at line 98 of file BSONObjectTypeDump.hpp.
References mongotype::BSONParserStackItem::getElement(), getOStream, istr(), params, and mongotype::BSONParserStack::top().
|
inlineprotectedvirtual |
BSON Object Successor Event.
[in] | stack | The BSONParserStack object containing the current parse context. |
Invoked once per each non-terminal BSON object after parsing the contained BSON elements.
Implements mongotype::IBSONObjectVisitor.
Definition at line 83 of file BSONObjectTypeDump.hpp.
References getOStream, istr(), and level.
|
inlineprotectedvirtual |
BSON Object Precursor Event.
[in] | stack | The BSONParserStack object containing the current parse context. |
Invoked once per each non-terminal BSON object before parsing the contained BSON elements.
Implements mongotype::IBSONObjectVisitor.
Definition at line 74 of file BSONObjectTypeDump.hpp.
References mongotype::BSONParserStackItem::getArrayIndex(), getOStream, istr(), level, and mongotype::BSONParserStack::top().
|
inlineprotectedvirtual |
Parser Destruction Event.
Invoked once each parse after all other events. Used to destroy the parse state.
Implements mongotype::IBSONObjectVisitor.
Definition at line 72 of file BSONObjectTypeDump.hpp.
|
inlineprotectedvirtual |
Parser Construction Event.
Invoked once each parse before all other events. Used to construct the parse state.
Implements mongotype::IBSONObjectVisitor.
Definition at line 68 of file BSONObjectTypeDump.hpp.
References level.
|
inlinevirtual |
Implements mongotype::IBSONRenderer.
Definition at line 142 of file BSONObjectTypeDump.hpp.
References getOStream, initialToken, and mongotype::BSONObjectParser::parse().
|
inlinevirtual |
Implements mongotype::IBSONRenderer.
Definition at line 120 of file BSONObjectTypeDump.hpp.
References getOStream.
|
private |
Definition at line 56 of file BSONObjectTypeDump.hpp.
Referenced by begin(), end(), onArrayStart(), onElement(), onObjectEnd(), onObjectStart(), render(), and setOutputStream().
|
private |
Definition at line 53 of file BSONObjectTypeDump.hpp.
Referenced by istr().
|
private |
Definition at line 54 of file BSONObjectTypeDump.hpp.
Referenced by render().
|
private |
Definition at line 55 of file BSONObjectTypeDump.hpp.
Referenced by istr(), onArrayEnd(), onArrayStart(), onObjectEnd(), onObjectStart(), and onParseStart().
|
private |
Definition at line 52 of file BSONObjectTypeDump.hpp.
Referenced by onElement().