00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00031
00032 #pragma once
00033
00034 #include "../Core/System/sharedptr.h"
00035 #include "api_regexp.h"
00036 #include "regexp_match.h"
00037
00038 class CL_RegExp_Impl;
00039
00043 class CL_API_REGEXP CL_RegExp
00044 {
00047
00048 public:
00049
00055 CL_RegExp(const char *expression, int compile_flags = 0, bool study = false);
00056
00062 CL_RegExp(const CL_StringRef8 &expression, int compile_flags = 0, bool study = false);
00063
00064 ~CL_RegExp();
00065
00069
00070 public:
00071 enum CompileFlags
00072 {
00073 compile_anchored = 1,
00074 compile_auto_callout = 2,
00075 compile_caseless = 4,
00076 compile_dollar_endonly = 8,
00077 compile_dot_all = 16,
00078 compile_extended = 32,
00079 compile_extra = 64,
00080 compile_multi_line = 128,
00081 compile_no_auto_capture = 256,
00082 compile_ungreedy = 512,
00083 compile_utf8 = 1024,
00084 compile_no_utf8_check = 2048
00085 };
00086
00087 enum SearchFlags
00088 {
00089 search_anchored = 1,
00090 search_not_bol = 2,
00091 search_not_eol = 4,
00092 search_not_empty = 8,
00093 search_no_utf8_check = 16,
00094 search_partial = 32
00095 };
00096
00102 int get_string_number(const char *name) const;
00103
00109 int get_string_number(const CL_StringRef8 &name) const;
00110
00114
00115 public:
00117 CL_RegExpMatch search(
00118 const char *subject,
00119 int length,
00120 int start_offset = 0,
00121 int search_flags = 0) const;
00122
00123 CL_RegExpMatch search(
00124 const CL_StringRef8 &subject,
00125 int start_offset = 0,
00126 int search_flags = 0) const;
00127
00128 void search(
00129 const char *subject,
00130 int length,
00131 int start_offset,
00132 int search_flags,
00133 CL_RegExpMatch &result) const;
00134
00135 void search(
00136 const CL_StringRef8 &subject,
00137 int start_offset,
00138 int search_flags,
00139 CL_RegExpMatch &result) const;
00140
00144
00145 private:
00146 CL_SharedPtr<CL_RegExp_Impl> impl;
00148 };
00149