Go to the documentation of this file.
211 #include <type_traits>
214 #if defined(__APPLE__)
215 #include <TargetConditionals.h>
218 #include "re2/stringpiece.h"
338 template <
typename F,
typename SP>
340 return f(sp, re, NULL, 0);
343 template <
typename F,
typename SP,
typename...
A>
346 const int n =
sizeof...(a);
347 return f(sp, re,
args,
n);
386 template <
typename...
A>
402 template <
typename...
A>
420 template <
typename...
A>
438 template <
typename...
A>
567 int nsubmatch)
const;
738 template <
typename T>
740 template <
typename T>
742 template <
typename T>
786 namespace re2_internal {
799 template <
typename T>
813 template <
typename T>
820 template <
typename T>
825 template <
typename T>
830 #if !defined(_MSC_VER)
831 template <
typename T>
833 std::is_member_function_pointer<
834 decltype(
static_cast<bool (
T::*)(
const char*,
size_t)
>(
843 template <
typename T, CanParse3ary<T> = 0>
846 template <
typename T, CanParse4ary<T> = 0>
849 #if !defined(_MSC_VER)
850 template <
typename T, CanParseFrom<T> = 0>
856 template <
typename T>
868 template <
typename T>
873 template <
typename T>
878 #if !defined(_MSC_VER)
879 template <
typename T>
881 if (
dest == NULL)
return true;
882 return reinterpret_cast<T*
>(
dest)->ParseFrom(
str,
n);
890 template <
typename T>
897 template <
typename T>
904 template <
typename T>
913 #if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 6
914 #pragma GCC diagnostic ignored "-Wmissing-field-initializers"
973 #define RE2_HAVE_THREAD_LOCAL
974 #if (defined(__APPLE__) && !TARGET_OS_OSX) || defined(__MINGW32__)
975 #undef RE2_HAVE_THREAD_LOCAL
987 #ifdef RE2_HAVE_THREAD_LOCAL
1000 #define DECLARE_HOOK(type) \
1001 using type##Callback = void(const type&); \
1002 void Set##type##Hook(type##Callback* cb); \
1003 type##Callback* Get##type##Hook();
1017 #endif // RE2_RE2_H_
bool Parse(const char *str, size_t n) const
static Arg CRadix(short *x)
static bool FullMatch(const StringPiece &text, const RE2 &re, A &&... a)
static bool PartialMatchN(const StringPiece &text, const RE2 &re, const Arg *const args[], int n)
#define DECLARE_HOOK(type)
typename std::enable_if< std::is_member_function_pointer< decltype(static_cast< bool(T::*)(const char *, size_t)>(&T::ParseFrom))>::value, int >::type CanParseFrom
const std::map< int, std::string > & CapturingGroupNames() const
bool word_boundary() const
bool PossibleMatchRange(std::string *min, std::string *max, int maxlen) const
static bool FullMatchN(const StringPiece &text, const RE2 &re, const Arg *const args[], int n)
typename std::enable_if< re2_internal::Parse4ary< T >::value, int >::type CanParse4ary
integral_constant< bool, true > true_type
RE2::CannedOptions options_
ErrorCode error_code() const
integral_constant< bool, false > false_type
void operator=(const LazyRE2 &)
int ProgramFanout(std::map< int, int > *histogram) const
static bool DoParseFrom(const char *str, size_t n, void *dest)
int ReverseProgramFanout(std::map< int, int > *histogram) const
static bool Extract(const StringPiece &text, const RE2 &re, const StringPiece &rewrite, std::string *out)
const std::string & error() const
void set_never_nl(bool b)
static bool Consume(StringPiece *input, const RE2 &re, A &&... a)
typename std::enable_if< re2_internal::Parse3ary< T >::value, int >::type CanParse3ary
void set_case_sensitive(bool b)
Arg(64) -> Arg(128) ->Arg(256) ->Arg(512) ->Arg(1024) ->Arg(1536) ->Arg(2048) ->Arg(3072) ->Arg(4096) ->Arg(5120) ->Arg(6144) ->Arg(7168)
#define T(upbtypeconst, upbtype, ctype, default_value)
RE2 & operator=(const RE2 &)=delete
re2::Prog * ReverseProg() const
static bool Replace(std::string *str, const RE2 &re, const StringPiece &rewrite)
bool DoMatch(const StringPiece &text, Anchor re_anchor, size_t *consumed, const Arg *const args[], int n) const
static bool FindAndConsume(StringPiece *input, const RE2 &re, A &&... a)
std::once_flag named_groups_once_
void call_once(absl::once_flag &flag, Callable &&fn, Args &&... args)
bool longest_match() const
static bool FindAndConsumeN(StringPiece *input, const RE2 &re, const Arg *const args[], int n)
const std::map< std::string, int > & NamedCapturingGroups() const
re2::Regexp * entire_regexp_
void set_one_line(bool b)
bool perl_classes() const
static Arg Octal(short *x)
const thread_local RE2 * context
const Options & options() const
bool CheckRewriteString(const StringPiece &rewrite, std::string *error) const
void set_posix_syntax(bool b)
bool posix_syntax() const
static int MaxSubmatch(const StringPiece &rewrite)
void set_log_errors(bool b)
static grpc_histogram * histogram
bool Parse(const char *str, size_t n, void *dest)
static bool PartialMatch(const StringPiece &text, const RE2 &re, A &&... a)
void set_max_mem(int64_t m)
re2::Regexp * Regexp() const
void set_perl_classes(bool b)
const std::map< std::string, int > * named_groups_
NoArg barrier_against_excess_initializers_
void set_never_capture(bool b)
static bool DoParse4ary(const char *str, size_t n, void *dest)
static const int kDefaultMaxMem
bool case_sensitive() const
static bool ConsumeN(StringPiece *input, const RE2 &re, const Arg *const args[], int n)
bool Match(const StringPiece &text, size_t startpos, size_t endpos, Anchor re_anchor, StringPiece *submatch, int nsubmatch) const
int ReverseProgramSize() const
static int GlobalReplace(std::string *str, const RE2 &re, const StringPiece &rewrite)
static std::string QuoteMeta(const StringPiece &unquoted)
void Init(const StringPiece &pattern, const Options &options)
void set_encoding(Encoding encoding)
const std::string & error_arg() const
static bool Apply(F f, SP sp, const RE2 &re)
void set_longest_match(bool b)
static void Init(const LazyRE2 *lazy_re2)
const std::string & pattern() const
void set_word_boundary(bool b)
static bool DoParse3ary(const char *str, size_t n, void *dest)
bool never_capture() const
std::once_flag group_names_once_
static bool DoNothing(const char *, size_t, void *)
bool(* Parser)(const char *str, size_t n, void *dest)
const std::map< int, std::string > * group_names_
static bool Apply(F f, SP sp, const RE2 &re, const A &... a)
int NumberOfCapturingGroups() const
const std::string * error_
bool Rewrite(std::string *out, const StringPiece &rewrite, const StringPiece *vec, int veclen) const
std::once_flag rprog_once_
re2::Regexp * suffix_regexp_
Encoding encoding() const
Arg(T *ptr, Parser parser)
void Copy(const Options &src)
grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:00