"use strict"; // Autogenerated by cport.py on 2013-09-17 14:37 var MatchExpression = module.exports = function MatchExpression( type ){ this._matchType = type; }, klass = MatchExpression, base = Object, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}}); // File: expression.h lines: 172-172 // MatchType _matchType; proto._matchType = undefined; // File: expression.h lines: 173-173 // boost::scoped_ptr _tagData; proto._tagData = undefined; /** * * This documentation was automatically generated. Please update when you touch this function. * @method _debugAddSpace * @param * */ proto._debugAddSpace = function _debugAddSpace( level ){ // StringBuilder& debug, int level // File: expression.cpp lines: 37-39 return new Array( level + 1).join(" "); }; /** * * This documentation was automatically generated. Please update when you touch this function. * @method getChild * @param * */ proto.getChild = function getChild( ) {// size_t i // File: expression.h lines: 78-77 throw new Error('Virtual function called.'); // return undefined; }; /** * * This documentation was automatically generated. Please update when you touch this function. * @method getTag * @param * */ proto.getTag = function getTag( ){ // File: expression.h lines: 159-158 return this._tagData.get(); }; /** * * This documentation was automatically generated. Please update when you touch this function. * @method isArray * @param * */ proto.isArray = function isArray( /* */ ){ // File: expression.h lines: 111-113 switch (this._matchType){ case 'SIZE': case 'ALL': case 'ELEM_MATCH_VALUE': case 'ELEM_MATCH_OBJECT': return true; break; default: return false; break; } return false; }; /** * * This documentation was automatically generated. Please update when you touch this function. * @method isLeaf * @param * */ proto.isLeaf = function isLeaf( /* */ ){ // File: expression.h lines: 124-125 return !isArray() && !isLogical(); }; /** * * This documentation was automatically generated. Please update when you touch this function. * @method isLogical * @param * */ proto.isLogical = function isLogical( /* */ ){ // File: expression.h lines: 100-101 switch( this._matchType ){ case 'AND': case 'OR': case 'NOT': case 'NOR': return true; default: return false; } return false; }; /** * * This documentation was automatically generated. Please update when you touch this function. * @method matchType * @param * */ proto.matchType = function matchType( /* */ ){ // File: expression.h lines: 67-66 return this._matchType; }; /** * * This documentation was automatically generated. Please update when you touch this function. * @method matchesBSON * @param * */ proto.matchesBSON = function matchesBSON( doc,detail ){ // const BSONObj& doc, MatchDetails* details // File: expression.cpp lines: 42-44 // bool MatchExpression::matchesBSON( const BSONObj& doc, MatchDetails* details ) const { // BSONMatchableDocument mydoc( doc ); // return matches( &mydoc, details ); // } return matches(new MatchableDocument(doc),details); }; /** * * This documentation was automatically generated. Please update when you touch this function. * @method numChildren * @param * */ proto.numChildren = function numChildren( /* */ ){ // File: expression.h lines: 73-72 return 0; }; /** * * This documentation was automatically generated. Please update when you touch this function. * @method path * @param * */ proto.path = function path( /* */ ){ // File: expression.h lines: 83-82 // virtual const StringData path() const { return StringData(); } return ''; }; /** * * This documentation was automatically generated. Please update when you touch this function. * @method setTag * @param * */ proto.setTag = function setTag( /* TagData* data */ ){ // File: expression.h lines: 158-157 // void setTag(TagData* data) { _tagData.reset(data); } this._tagData.reset(data); }; /** * * This documentation was automatically generated. Please update when you touch this function. * @method toString * @param * */ proto.toString = function toString( /* */ ){ // File: expression.cpp lines: 31-34 // string MatchExpression::toString() const { // StringBuilder buf; // debugString( buf, 0 ); // return buf.str(); // } return this.debugString(); };