MongoDB  2.7.0
Public Member Functions | Static Public Member Functions | List of all members
mongo::LexNumCmp Class Reference

Functor for combining lexical and numeric comparisons. More...

#include <stringutils.h>

Public Member Functions

 LexNumCmp (bool lexOnly)
 
int cmp (const StringData &s1, const StringData &s2) const
 
bool operator() (const StringData &s1, const StringData &s2) const
 

Static Public Member Functions

static int cmp (const StringData &s1, const StringData &s2, bool lexOnly)
 Non numeric characters are compared lexicographically; numeric substrings are compared numerically; dots separate ordered comparable subunits. More...
 

Detailed Description

Functor for combining lexical and numeric comparisons.

Constructor & Destructor Documentation

mongo::LexNumCmp::LexNumCmp ( bool  lexOnly)
Parameters
lexOnly- compare all characters lexically, including digits.

Member Function Documentation

int mongo::LexNumCmp::cmp ( const StringData &  s1,
const StringData &  s2,
bool  lexOnly 
)
static

Non numeric characters are compared lexicographically; numeric substrings are compared numerically; dots separate ordered comparable subunits.

For convenience, character 255 is greater than anything else.

Parameters
lexOnly- compare all characters lexically, including digits.

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