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

BSON Element Type String Lookup. More...

#include <BSONTypeMap.hpp>

Details:

BSON Element Type String Lookup.

Provides conversion from BSON integer element type codes to human readable strings.

Definition at line 95 of file BSONTypeMap.hpp.

Inheritance diagram for mongotype::BSONTypeMap:

Public Member Functions

 BSONTypeMap (const BSONElement &e)
 Construct a type lookup instance. More...
 
const BSONTypeElementlookup (BSONType type)
 
const BSONTypeElementlookup ()
 
string to_string ()
 Stringize BSON Object Type. More...
 
 OSTREAM_FRIEND (BSONTypeMap &bstn)
 BSON Object Type Strings Stream Output Operator. More...
 

Protected Attributes

const BSONElement & element
 

Constructor & Destructor Documentation

mongotype::BSONTypeMap::BSONTypeMap ( const BSONElement &  e)
inline

Construct a type lookup instance.

Parameters
[in]eThe BSONElement whose type string will be looked up.

Definition at line 109 of file BSONTypeMap.hpp.

Member Function Documentation

const BSONTypeElement & mongotype::BSONTypeMap::lookup ( BSONType  type)

Lookup the given BSONType. Intended for repeated lookup calls without construction overhead.

Look up the given type.

Parameters
[in]typeThe BSON type to convert to string(s).
Returns
The BSONTypeElement or "UNKNOWN" if not found.

Definition at line 76 of file BSONTypeMap.cpp.

References mongotype::BSONTypeLookupTable.

const BSONTypeElement& mongotype::BSONTypeMap::lookup ( )
inline

Lookup the given BSONType for this instance.

Definition at line 121 of file BSONTypeMap.hpp.

References element.

Referenced by mongotype::BSONTypeFormatter::to_string(), and to_string().

Here is the caller graph for this function:

mongotype::BSONTypeMap::OSTREAM_FRIEND ( BSONTypeMap bstn)
inline

BSON Object Type Strings Stream Output Operator.

Parameters
[in]bstnThe BSONTypeMap object to write to the output stream.

Definition at line 143 of file BSONTypeMap.hpp.

References to_string().

Here is the call graph for this function:

string mongotype::BSONTypeMap::to_string ( )
inline

Stringize BSON Object Type.

Returns
String representation of the BSON type.

Definition at line 129 of file BSONTypeMap.hpp.

References mongotype::BSONTypeElement::getDesc(), mongotype::BSONTypeElement::getName(), and lookup().

Referenced by OSTREAM_FRIEND().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

const BSONElement& mongotype::BSONTypeMap::element
protected

The BSON element supplying the type information.

Definition at line 101 of file BSONTypeMap.hpp.

Referenced by lookup(), and mongotype::BSONTypeFormatter::to_string().


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