RegexMatchExpression.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. "use strict"
  2. // Autogenerated by cport.py on 2013-09-17 14:37
  3. var RegexMatchExpression = module.exports = function (){
  4. }, klass = RegexMatchExpression, base = Object , proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
  5. // File: expression_leaf.h lines: 160-160
  6. // static const size_t MaxPatternSize = 32764;
  7. proto.MaxPatternSize = undefined;
  8. // File: expression_leaf.h lines: 184-184
  9. // std::string _flags;
  10. proto._flags = undefined;
  11. // File: expression_leaf.h lines: 185-185
  12. // boost::scoped_ptr<pcrecpp::RE> _re;
  13. proto._re = undefined;
  14. // File: expression_leaf.h lines: 183-183
  15. // std::string _regex;
  16. proto._regex = undefined;
  17. // File: expression_leaf.h lines: 160-160
  18. // static const size_t MaxPatternSize = 32764;
  19. proto.MaxPatternSize = undefined;
  20. // File: expression_leaf.h lines: 184-184
  21. // std::string _flags;
  22. proto._flags = undefined;
  23. // File: expression_leaf.h lines: 185-185
  24. // boost::scoped_ptr<pcrecpp::RE> _re;
  25. proto._re = undefined;
  26. // File: expression_leaf.h lines: 183-183
  27. // std::string _regex;
  28. proto._regex = undefined;
  29. /**
  30. *
  31. * This documentation was automatically generated. Please update when you touch this function.
  32. * @method RegexMatchExpression
  33. * @param
  34. *
  35. */
  36. proto.RegexMatchExpression = function RegexMatchExpression( /* REGEX */ ){
  37. // File: expression_leaf.h lines: 162-161
  38. // RegexMatchExpression() : LeafMatchExpression( REGEX ){}
  39. }
  40. /**
  41. *
  42. * This documentation was automatically generated. Please update when you touch this function.
  43. * @method debugString
  44. * @param
  45. *
  46. */
  47. proto.debugString = function debugString( /* StringBuilder& debug, int level */ ){
  48. // File: expression_leaf.cpp lines: 225-234
  49. // void RegexMatchExpression::debugString( StringBuilder& debug, int level ) const {
  50. // _debugAddSpace( debug, level );
  51. // debug << path() << " regex /" << _regex << "/" << _flags;
  52. //
  53. // MatchExpression::TagData* td = getTag();
  54. // if (NULL != td) {
  55. // debug << " ";
  56. // td->debugString(&debug);
  57. // }
  58. // debug << "\n";
  59. // }
  60. }
  61. /**
  62. *
  63. * This documentation was automatically generated. Please update when you touch this function.
  64. * @method equivalent
  65. * @param
  66. *
  67. */
  68. proto.equivalent = function equivalent( /* const MatchExpression* other */ ){
  69. // File: expression_leaf.cpp lines: 177-185
  70. // bool RegexMatchExpression::equivalent( const MatchExpression* other ) const {
  71. // if ( matchType() != other->matchType() )
  72. // return false;
  73. //
  74. // const RegexMatchExpression* realOther = static_cast<const RegexMatchExpression*>( other );
  75. // return
  76. // path() == realOther->path() &&
  77. // _regex == realOther->_regex
  78. // && _flags == realOther->_flags;
  79. // }
  80. }
  81. /**
  82. *
  83. * This documentation was automatically generated. Please update when you touch this function.
  84. * @method getFlags
  85. * @param
  86. *
  87. */
  88. proto.getFlags = function getFlags( /* */ ){
  89. // File: expression_leaf.h lines: 180-179
  90. // const string& getFlags() const { return _flags; }
  91. }
  92. /**
  93. *
  94. * This documentation was automatically generated. Please update when you touch this function.
  95. * @method getString
  96. * @param
  97. *
  98. */
  99. proto.getString = function getString( /* */ ){
  100. // File: expression_leaf.h lines: 179-178
  101. // const string& getString() const { return _regex; }
  102. }
  103. /**
  104. *
  105. * This documentation was automatically generated. Please update when you touch this function.
  106. * @method init
  107. * @param
  108. *
  109. */
  110. proto.init = function init( /* const StringData& path, const StringData& regex, const StringData& options */ ){
  111. // File: expression_leaf.cpp lines: 196-205
  112. // Status RegexMatchExpression::init( const StringData& path, const StringData& regex, const StringData& options ) {
  113. // if ( regex.size() > MaxPatternSize ) {
  114. // return Status( ErrorCodes::BadValue, "Regular expression is too long" );
  115. // }
  116. //
  117. // _regex = regex.toString();
  118. // _flags = options.toString();
  119. // _re.reset( new pcrecpp::RE( _regex.c_str(), flags2options( _flags.c_str() ) ) );
  120. //
  121. // return initPath( path );
  122. // }
  123. }
  124. /**
  125. *
  126. * This documentation was automatically generated. Please update when you touch this function.
  127. * @method matchesSingleElement
  128. * @param
  129. *
  130. */
  131. proto.matchesSingleElement = function matchesSingleElement( /* const BSONElement& e */ ){
  132. // File: expression_leaf.cpp lines: 208-222
  133. // bool RegexMatchExpression::matchesSingleElement( const BSONElement& e ) const {
  134. // //log() << "RegexMatchExpression::matchesSingleElement _regex: " << _regex << " e: " << e << std::endl;
  135. // switch (e.type()) {
  136. // case String:
  137. // case Symbol:
  138. // // TODO
  139. // //if (rm._prefix.empty())
  140. // return _re->PartialMatch(e.valuestr());
  141. // //else
  142. // //return !strncmp(e.valuestr(), rm._prefix.c_str(), rm._prefix.size());
  143. // case RegEx:
  144. // return _regex == e.regex() && _flags == e.regexFlags();
  145. // default:
  146. // return false;
  147. // }
  148. // }
  149. }
  150. /**
  151. *
  152. * This documentation was automatically generated. Please update when you touch this function.
  153. * @method shallowClone
  154. * @param
  155. *
  156. */
  157. proto.shallowClone = function shallowClone( /* */ ){
  158. // File: expression_leaf.h lines: 167-170
  159. // virtual LeafMatchExpression* shallowClone() const {
  160. // RegexMatchExpression* e = new RegexMatchExpression();
  161. // e->init( path(), _regex, _flags );
  162. // return e;
  163. // }
  164. }