diff options
Diffstat (limited to 'src/mongo/db/matcher/expression.cpp')
-rw-r--r-- | src/mongo/db/matcher/expression.cpp | 62 |
1 files changed, 29 insertions, 33 deletions
diff --git a/src/mongo/db/matcher/expression.cpp b/src/mongo/db/matcher/expression.cpp index 99975a88815..aa6a2ddbc30 100644 --- a/src/mongo/db/matcher/expression.cpp +++ b/src/mongo/db/matcher/expression.cpp @@ -35,46 +35,42 @@ namespace mongo { - using std::string; +using std::string; - MatchExpression::MatchExpression( MatchType type ) - : _matchType( type ) { } - - string MatchExpression::toString() const { - StringBuilder buf; - debugString( buf, 0 ); - return buf.str(); - } - - void MatchExpression::_debugAddSpace( StringBuilder& debug, int level ) const { - for ( int i = 0; i < level; i++ ) - debug << " "; - } - - bool MatchExpression::matchesBSON( const BSONObj& doc, MatchDetails* details ) const { - BSONMatchableDocument mydoc( doc ); - return matches( &mydoc, details ); - } +MatchExpression::MatchExpression(MatchType type) : _matchType(type) {} +string MatchExpression::toString() const { + StringBuilder buf; + debugString(buf, 0); + return buf.str(); +} - void AtomicMatchExpression::debugString( StringBuilder& debug, int level ) const { - _debugAddSpace( debug, level ); - debug << "$atomic\n"; - } +void MatchExpression::_debugAddSpace(StringBuilder& debug, int level) const { + for (int i = 0; i < level; i++) + debug << " "; +} - void AtomicMatchExpression::toBSON(BSONObjBuilder* out) const { - out->append("$isolated", 1); - } +bool MatchExpression::matchesBSON(const BSONObj& doc, MatchDetails* details) const { + BSONMatchableDocument mydoc(doc); + return matches(&mydoc, details); +} - void FalseMatchExpression::debugString( StringBuilder& debug, int level ) const { - _debugAddSpace( debug, level ); - debug << "$false\n"; - } - void FalseMatchExpression::toBSON(BSONObjBuilder* out) const { - out->append("$false", 1); - } +void AtomicMatchExpression::debugString(StringBuilder& debug, int level) const { + _debugAddSpace(debug, level); + debug << "$atomic\n"; +} +void AtomicMatchExpression::toBSON(BSONObjBuilder* out) const { + out->append("$isolated", 1); } +void FalseMatchExpression::debugString(StringBuilder& debug, int level) const { + _debugAddSpace(debug, level); + debug << "$false\n"; +} +void FalseMatchExpression::toBSON(BSONObjBuilder* out) const { + out->append("$false", 1); +} +} |