MongoType
MongoDB Collection Data Dump with BSON Types
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mongotype::BSONDotNotationDump Class Reference

Human readable BSON Object Dump. More...

#include <BSONDotNotationDump.hpp>

Details:

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.

See Also
IBSONObjectVisitor, BSONObjectParser

Definition at line 51 of file BSONDotNotationDump.hpp.

Inheritance diagram for mongotype::BSONDotNotationDump:
Collaboration diagram for mongotype::BSONDotNotationDump:

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)
 
- Public Member Functions inherited from mongotype::IBSONRenderer
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...
 
- Protected Member Functions inherited from mongotype::IBSONObjectVisitor
virtual ~IBSONObjectVisitor ()
 

Private Attributes

Parametersparams
 
deque< string > dotStack
 
function< ostream &()> getOStream
 

Constructor & Destructor Documentation

mongotype::BSONDotNotationDump::BSONDotNotationDump ( Parameters pparams,
string &  initialToken 
)
inline

Construct a BSON object dumper.

Parameters
[in]pparamsThe command line parameters object.
[in]initialTokenThe 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.

virtual mongotype::BSONDotNotationDump::~BSONDotNotationDump ( )
inlinevirtual

Definition at line 114 of file BSONDotNotationDump.hpp.

Member Function Documentation

virtual void mongotype::BSONDotNotationDump::begin ( const char *  prefix)
inlinevirtual

Implements mongotype::IBSONRenderer.

Definition at line 126 of file BSONDotNotationDump.hpp.

References getOStream.

virtual void mongotype::BSONDotNotationDump::end ( const char *  suffix)
inlinevirtual

Implements mongotype::IBSONRenderer.

Definition at line 135 of file BSONDotNotationDump.hpp.

References getOStream.

virtual void mongotype::BSONDotNotationDump::onArrayEnd ( const BSONParserStack stack)
inlineprotectedvirtual

BSON Array Successor Event.

Parameters
[in]stackThe 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.

virtual void mongotype::BSONDotNotationDump::onArrayStart ( const BSONParserStack stack)
inlineprotectedvirtual

BSON Array Precursor Event.

Parameters
[in]stackThe 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().

Here is the call graph for this function:

virtual void mongotype::BSONDotNotationDump::onElement ( const BSONParserStack stack)
inlineprotectedvirtual

BSON Element Event.

Parameters
[in]stackThe 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().

Here is the call graph for this function:

virtual void mongotype::BSONDotNotationDump::onObjectEnd ( const BSONParserStack stack)
inlineprotectedvirtual

BSON Object Successor Event.

Parameters
[in]stackThe 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().

Here is the call graph for this function:

virtual void mongotype::BSONDotNotationDump::onObjectStart ( const BSONParserStack stack)
inlineprotectedvirtual

BSON Object Precursor Event.

Parameters
[in]stackThe 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().

Here is the call graph for this function:

virtual void mongotype::BSONDotNotationDump::onParseEnd ( )
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.

virtual void mongotype::BSONDotNotationDump::onParseStart ( )
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.

virtual void mongotype::BSONDotNotationDump::render ( const BSONObj &  object,
int  docIndex,
int  docCount 
)
inlinevirtual

Implements mongotype::IBSONRenderer.

Definition at line 141 of file BSONDotNotationDump.hpp.

References getOStream, and mongotype::BSONObjectParser::parse().

Here is the call graph for this function:

virtual void mongotype::BSONDotNotationDump::setOutputStream ( std::ostream &  os)
inlinevirtual

Implements mongotype::IBSONRenderer.

Definition at line 119 of file BSONDotNotationDump.hpp.

References getOStream.

Member Data Documentation

deque<string> mongotype::BSONDotNotationDump::dotStack
private
function<ostream&()> mongotype::BSONDotNotationDump::getOStream
private

Definition at line 54 of file BSONDotNotationDump.hpp.

Referenced by begin(), end(), onElement(), render(), and setOutputStream().

Parameters& mongotype::BSONDotNotationDump::params
private

Definition at line 52 of file BSONDotNotationDump.hpp.

Referenced by onElement().


The documentation for this class was generated from the following file: