"use strict"; var ArrayMatchingMatchExpression = require('./ArrayMatchingMatchExpression'); // Autogenerated by cport.py on 2013-09-17 14:37 var SizeMatchExpression = module.exports = function SizeMatchExpression(){ this._matchType = 'SIZE'; }, klass = SizeMatchExpression, base = ArrayMatchingMatchExpression, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}}); // File: expression_array.h lines: 131-131 // int _size; // >= 0 real, < 0, nothing will match proto._size = undefined; /** * * This documentation was automatically generated. Please update when you touch this function. * @method debugString * @param * */ proto.debugString = function debugString( level ) { // StringBuilder& debug, int level // File: expression_array.cpp lines: 259-261 return this._debugAddSpace( level ) + this.path() + " $size : " + str(this._size) + "\n"; }; /** * * This documentation was automatically generated. Please update when you touch this function. * @method equivalent * @param * */ proto.equivalent = function equivalent( other ) { // const MatchExpression* other // File: expression_array.cpp lines: 264-269 if(other._matchType != 'SIZE') { return false; } return this._size == other._size && this._path == other._size; }; /** * * This documentation was automatically generated. Please update when you touch this function. * @method getData * @param * */ proto.getData = function getData( /* */ ){ // File: expression_array.h lines: 128-127 return this._size; }; /** * * This documentation was automatically generated. Please update when you touch this function. * @method init * @param * */ proto.init = function init( path,size ) { // const StringData& path, int size // File: expression_array.cpp lines: 248-250 this._size = size; return this.initPath(path); }; /** * * This documentation was automatically generated. Please update when you touch this function. * @method matchesArray * @param * */ proto.matchesArray = function matchesArray( anArray,details ) { // const BSONObj& anArray, MatchDetails* details // File: expression_array.cpp lines: 253-256 if(this._size < 0) { return false; } return anArray.length == this._size(); }; /** * * This documentation was automatically generated. Please update when you touch this function. * @method shallowClone * @param * */ proto.shallowClone = function shallowClone( /* */ ){ // File: expression_array.h lines: 116-119 // virtual SizeMatchExpression* shallowClone() const { // SizeMatchExpression* e = new SizeMatchExpression(); // e->init(path(), _size); // return e; // } var e = new SizeMatchExpression(); e.init(this.path(),this._size); return e; };