public BSONRegularExpression(string pattern, BSONRegularExpressionOptions options) { if (pattern == null) { throw new BSONException(StringConsts.ARGUMENT_ERROR + "BSONRegularExpression.ctor(pattern==null)"); } Pattern = pattern; Options = options; }
/// <summary> /// Returns BSON-formatted string for regeax options /// (The options are identified by lower-case characters, which must be stored in alphabetical order). /// </summary> public static string ToBSONString(this BSONRegularExpressionOptions options) { string result = string.Empty; for (int i = 0; i < _values.Length; i++) { if ((options & _values[i]) != 0) { result += _values[i]; } } return(result.ToLower()); }
/// <summary> /// Returns regex options count /// </summary> public static byte Count(this BSONRegularExpressionOptions options) { byte result = 0; for (int i = 0; i < _values.Length; i++) { if ((options & _values[i]) != 0) { result += 1; } } return(result); }
public BSONRegularExpression(string pattern, BSONRegularExpressionOptions options) { if (pattern==null) throw new BSONException(StringConsts.ARGUMENT_ERROR+"BSONRegularExpression.ctor(pattern==null)"); Pattern = pattern; Options = options; }