| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- "use strict";
- var MatchExpression = require('./MatchExpression');
- var ElementPath = require('./ElementPath');
- // Autogenerated by cport.py on 2013-09-17 14:37
- var LeafMatchExpression = module.exports = function LeafMatchExpression( type ){
- this._matchType = type;
- this._elementPath = new ElementPath();
- }, klass = LeafMatchExpression, base = MatchExpression, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
- // File: expression_leaf.h lines: 63-63
- // ElementPath _elementPath;
- proto._elementPath = undefined;
- // File: expression_leaf.h lines: 62-62
- // StringData _path;
- proto._path = undefined;
- /**
- *
- * This documentation was automatically generated. Please update when you touch this function.
- * @method initPath
- * @param
- *
- */
- proto.initPath = function initPath( path ) { // const StringData& path
- // File: expression_leaf.cpp lines: 31-33
- this._path = path;
- if(this._elementPath === undefined){
- this._elementPath = new ElementPath();
- }
- return this._elementPath.init( this._path );
- };
- /**
- *
- * This documentation was automatically generated. Please update when you touch this function.
- * @method matches
- * @param
- *
- */
- proto.matches = function matches( /* const MatchableDocument* doc, MatchDetails* details */ ){
- // File: expression_leaf.cpp lines: 37-48
- var docKeys = Object.keys(doc);
- for(var i = 0;i < docKeys.length; i++ ) {
- if(!this.matchesSingleElement( doc[docKeys[i]] ))
- continue;
- if( details && details.needRecord() && (doc instanceof Array) && i < docKeys.length-1 ) {
- details.setElemMatchKey( docKeys[i+1] );
- }
- return true;
- }
- return false;
- };
- /**
- *
- * This documentation was automatically generated. Please update when you touch this function.
- * @method path
- * @param
- *
- */
- proto.path = function path( /* */ ){
- // File: expression_leaf.h lines: 56-55
- return this._path;
- };
|