MongoType
MongoDB Collection Data Dump with BSON Types
|
Human readable BSON Object Dump. More...
#include <BSONDotNotationDump.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 BSONDotNotationDump.hpp.
Public Member Functions | |
BSONDotNotationDump (Parameters &pparams, string &initialToken) | |
Construct a BSON object dumper. More... | |
virtual | ~BSONDotNotationDump () |
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 Attributes | |
Parameters & | params |
deque< string > | dotStack |
function< ostream &()> | getOStream |
|
inline |
Construct a BSON object dumper.
[in] | pparams | The command line parameters object. |
[in] | initialToken | 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 108 of file BSONDotNotationDump.hpp.
References dotStack.
|
inlinevirtual |
Definition at line 114 of file BSONDotNotationDump.hpp.
|
inlinevirtual |
Implements mongotype::IBSONRenderer.
Definition at line 126 of file BSONDotNotationDump.hpp.
References getOStream.
|
inlinevirtual |
Implements mongotype::IBSONRenderer.
Definition at line 135 of file BSONDotNotationDump.hpp.
References getOStream.
|
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 83 of file BSONDotNotationDump.hpp.
References dotStack.
|
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 77 of file BSONDotNotationDump.hpp.
References dotStack, mongotype::BSONParserStackItem::getArray(), 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 87 of file BSONDotNotationDump.hpp.
References dotStack, mongotype::BSONParserStackItem::getElement(), getOStream, params, mongotype::BSONTypeFormatter::to_string(), 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 71 of file BSONDotNotationDump.hpp.
References dotStack, mongotype::BSONParserStackItem::getArrayIndex(), and mongotype::BSONParserStack::top().
|
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 62 of file BSONDotNotationDump.hpp.
References dotStack, mongotype::BSONParserStackItem::getArrayIndex(), 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 60 of file BSONDotNotationDump.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 58 of file BSONDotNotationDump.hpp.
|
inlinevirtual |
Implements mongotype::IBSONRenderer.
Definition at line 141 of file BSONDotNotationDump.hpp.
References getOStream, and mongotype::BSONObjectParser::parse().
|
inlinevirtual |
Implements mongotype::IBSONRenderer.
Definition at line 119 of file BSONDotNotationDump.hpp.
References getOStream.
|
private |
Definition at line 53 of file BSONDotNotationDump.hpp.
Referenced by BSONDotNotationDump(), onArrayEnd(), onArrayStart(), onElement(), onObjectEnd(), and onObjectStart().
|
private |
Definition at line 54 of file BSONDotNotationDump.hpp.
Referenced by begin(), end(), onElement(), render(), and setOutputStream().
|
private |
Definition at line 52 of file BSONDotNotationDump.hpp.
Referenced by onElement().