mongo::BSONObjIterator Class Reference

#include <bsonobjiterator.h>

List of all members.

Public Member Functions

 BSONObjIterator (const char *start, const char *end)
 BSONObjIterator (const BSONObj &jso)
bool more ()
bool moreWithEOO ()
BSONElement next (bool checkEnd=false)
BSONElement operator* ()
void operator++ (int)
void operator++ ()

Private Attributes

const char * _pos
const char * _theend

Detailed Description

iterator for a BSONObj

Note each BSONObj ends with an EOO element: so you will get more() on an empty object, although next().eoo() will be true.

todo: we may want to make a more stl-like iterator interface for this with things like begin() and end()

Definition at line 32 of file bsonobjiterator.h.


Constructor & Destructor Documentation

mongo::BSONObjIterator::BSONObjIterator ( const BSONObj jso  )  [inline]

Create an iterator for a BSON object.

Definition at line 36 of file bsonobjiterator.h.

mongo::BSONObjIterator::BSONObjIterator ( const char *  start,
const char *  end 
) [inline]

Definition at line 46 of file bsonobjiterator.h.


Member Function Documentation

bool mongo::BSONObjIterator::more (  )  [inline]
Returns:
true if more elements exist to be enumerated.

Definition at line 52 of file bsonobjiterator.h.

bool mongo::BSONObjIterator::moreWithEOO (  )  [inline]
Returns:
true if more elements exist to be enumerated INCLUDING the EOO element which is always at the end.

Definition at line 55 of file bsonobjiterator.h.

BSONElement mongo::BSONObjIterator::next ( bool  checkEnd = false  )  [inline]
Returns:
the next element in the object. For the final element, element.eoo() will be true.

Definition at line 58 of file bsonobjiterator.h.

BSONElement mongo::BSONObjIterator::operator* (  )  [inline]

Definition at line 68 of file bsonobjiterator.h.

void mongo::BSONObjIterator::operator++ ( int   )  [inline]

Definition at line 66 of file bsonobjiterator.h.

void mongo::BSONObjIterator::operator++ (  )  [inline]

Definition at line 65 of file bsonobjiterator.h.


Member Data Documentation

const char* mongo::BSONObjIterator::_pos [private]

Definition at line 74 of file bsonobjiterator.h.

const char* mongo::BSONObjIterator::_theend [private]

Definition at line 75 of file bsonobjiterator.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


mongodb
Author(s): Nate Koenig
autogenerated on Fri Jan 11 12:15:53 2013