MongoDB  2.7.0
Classes | Public Member Functions | List of all members
mongo::BufReader Class Reference

helper to read and parse a block of memory methods throw the eof exception if the operation would pass the end of the buffer with which we are working. More...

#include <bufreader.h>

Inheritance diagram for mongo::BufReader:

Classes

class  eof
 

Public Member Functions

 BufReader (const void *p, unsigned len)
 
bool atEof () const
 
template<typename T >
void read (T &t)
 read in the object specified, and advance buffer pointer
 
template<typename T >
read ()
 read in and return an object of the specified type, and advance buffer pointer
 
template<typename T >
void peek (T &t) const
 read in the object specified, but do not advance buffer pointer
 
template<typename T >
peek () const
 read in and return an object of the specified type, but do not advance buffer pointer
 
unsigned offset () const
 return current offset into buffer
 
unsigned remaining () const
 return remaining bytes
 
void rewind (unsigned nbytes)
 back up by nbytes
 
const void * skip (unsigned len)
 return current position pointer, and advance by len
 
StringData readCStr ()
 reads a NUL terminated string
 
void readStr (string &s)
 
const void * pos ()
 
const void * start ()
 

Detailed Description

helper to read and parse a block of memory methods throw the eof exception if the operation would pass the end of the buffer with which we are working.


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