Storage Engine API
mongo::Namespace Class Reference

This is used for storing a namespace on disk in a fixed witdh form and should only be used for that, not for passing internally. More...

#include <namespace.h>

Detailed Description

This is used for storing a namespace on disk in a fixed witdh form and should only be used for that, not for passing internally.

If you need to pass internally, please use NamespaceString.

Public Types

enum  MaxNsLenValue { MaxNsLenWithNUL = 128, MaxNsLen = MaxNsLenWithNUL - 1, MaxNsCollectionLen = MaxNsLen - 7 }
 

Public Member Functions

 Namespace (StringData ns)
 
Namespaceoperator= (StringData ns)
 
void kill ()
 
bool operator== (const char *r) const
 
bool operator== (const Namespace &r) const
 
bool operator!= (const char *r) const
 
bool operator!= (const Namespace &r) const
 
bool hasDollarSign () const
 
int hash () const
 Value returned is always > 0. More...
 
size_t size () const
 
std::string toString () const
 
 operator std::string () const
 
std::string extraName (int i) const
 NamespaceDetails::Extra was added after fact to allow chaining of data blocks to support more than 10 indexes (more than 10 IndexDetails). More...
 
bool isExtra () const
 Returns whether the namespace ends with "$extr...". More...
 

Private Attributes

char buf [MaxNsLenWithNUL]
 

Member Enumeration Documentation

◆ MaxNsLenValue

Enumerator
MaxNsLenWithNUL 
MaxNsLen 
MaxNsCollectionLen 

Constructor & Destructor Documentation

◆ Namespace()

mongo::Namespace::Namespace ( StringData  ns)
inline

Member Function Documentation

◆ extraName()

std::string mongo::Namespace::extraName ( int  i) const
inline

NamespaceDetails::Extra was added after fact to allow chaining of data blocks to support more than 10 indexes (more than 10 IndexDetails).

It's a bit hacky because of this late addition with backward file support.

◆ hasDollarSign()

bool mongo::Namespace::hasDollarSign ( ) const
inline

◆ hash()

int mongo::Namespace::hash ( ) const
inline

Value returned is always > 0.

◆ isExtra()

bool mongo::Namespace::isExtra ( ) const
inline

Returns whether the namespace ends with "$extr...".

When true it represents an extra block not a normal NamespaceDetails block.

◆ kill()

void mongo::Namespace::kill ( )
inline

◆ operator std::string()

mongo::Namespace::operator std::string ( ) const
inline

◆ operator!=() [1/2]

bool mongo::Namespace::operator!= ( const char *  r) const
inline

◆ operator!=() [2/2]

bool mongo::Namespace::operator!= ( const Namespace r) const
inline

◆ operator=()

Namespace& mongo::Namespace::operator= ( StringData  ns)
inline

◆ operator==() [1/2]

bool mongo::Namespace::operator== ( const char *  r) const
inline

◆ operator==() [2/2]

bool mongo::Namespace::operator== ( const Namespace r) const
inline

◆ size()

size_t mongo::Namespace::size ( ) const
inline

◆ toString()

std::string mongo::Namespace::toString ( ) const
inline

Member Data Documentation

◆ buf

char mongo::Namespace::buf[MaxNsLenWithNUL]
private

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