Go to the documentation of this file.
199 #include "re2/stringpiece.h"
318 template <
typename F,
typename SP>
320 return f(sp, re, NULL, 0);
323 template <
typename F,
typename SP,
typename...
A>
326 const int n =
sizeof...(a);
327 return f(sp, re,
args,
n);
366 template <
typename...
A>
373 template <
typename...
A>
382 template <
typename...
A>
391 template <
typename...
A>
520 int nsubmatch)
const;
703 static inline Arg CRadix(
unsigned short* x);
705 static inline Arg CRadix(
unsigned int* x);
707 static inline Arg CRadix(
unsigned long* x);
709 static inline Arg CRadix(
unsigned long long* x);
711 static inline Arg Hex(
short* x);
712 static inline Arg Hex(
unsigned short* x);
713 static inline Arg Hex(
int* x);
714 static inline Arg Hex(
unsigned int* x);
715 static inline Arg Hex(
long* x);
716 static inline Arg Hex(
unsigned long* x);
717 static inline Arg Hex(
long long* x);
718 static inline Arg Hex(
unsigned long long* x);
721 static inline Arg Octal(
unsigned short* x);
723 static inline Arg Octal(
unsigned int* x);
725 static inline Arg Octal(
unsigned long* x);
726 static inline Arg Octal(
long long* x);
727 static inline Arg Octal(
unsigned long long* x);
780 if (
dest == NULL)
return true;
781 T*
object =
reinterpret_cast<T*
>(
dest);
782 return object->ParseFrom(
str,
n);
798 #define MAKE_PARSER(type, name) \
799 Arg(type* p) : arg_(p), parser_(name) {} \
800 Arg(type* p, Parser parser) : arg_(p), parser_(parser) {}
828 bool Parse(
const char*
str,
size_t n)
const;
843 #define DECLARE_INTEGER_PARSER(name) \
845 static bool parse_##name(const char* str, size_t n, void* dest); \
846 static bool parse_##name##_radix(const char* str, size_t n, void* dest, \
850 static bool parse_##name##_hex(const char* str, size_t n, void* dest); \
851 static bool parse_##name##_octal(const char* str, size_t n, void* dest); \
852 static bool parse_##name##_cradix(const char* str, size_t n, void* dest);
863 #undef DECLARE_INTEGER_PARSER
876 #define MAKE_INTEGER_PARSER(type, name) \
877 inline RE2::Arg RE2::Hex(type* ptr) { \
878 return RE2::Arg(ptr, RE2::Arg::parse_##name##_hex); \
880 inline RE2::Arg RE2::Octal(type* ptr) { \
881 return RE2::Arg(ptr, RE2::Arg::parse_##name##_octal); \
883 inline RE2::Arg RE2::CRadix(type* ptr) { \
884 return RE2::Arg(ptr, RE2::Arg::parse_##name##_cradix); \
896 #undef MAKE_INTEGER_PARSER
902 #if defined(__clang__)
903 #elif defined(__GNUC__) && __GNUC__ >= 6
904 #pragma GCC diagnostic ignored "-Wmissing-field-initializers"
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 parse_string(const char *str, size_t n, void *dest)
absl::string_view get(const Cont &c)
static bool PartialMatchN(const StringPiece &text, const RE2 &re, const Arg *const args[], int n)
MAKE_INTEGER_PARSER(short, short)
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)
RE2::CannedOptions options_
ErrorCode error_code() const
static bool parse_char(const char *str, size_t n, void *dest)
int ProgramFanout(std::map< int, int > *histogram) const
int ReverseProgramFanout(std::map< int, int > *histogram) const
static bool Extract(const StringPiece &text, const RE2 &re, const StringPiece &rewrite, std::string *out)
static bool parse_double(const char *str, size_t n, void *dest)
const std::string & error() const
void set_never_nl(bool b)
static bool Consume(StringPiece *input, const RE2 &re, A &&... a)
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
static bool parse_uchar(const char *str, size_t n, void *dest)
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 parse_schar(const char *str, size_t n, void *dest)
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)
static bool Parse(const char *str, size_t n, void *dest)
bool perl_classes() const
static Arg Octal(short *x)
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)
#define DECLARE_INTEGER_PARSER(name)
void set_log_errors(bool b)
static bool parse_float(const char *str, size_t n, void *dest)
static grpc_histogram * histogram
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 const int kDefaultMaxMem
#define MAKE_PARSER(type, name)
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)
static bool parse_stringpiece(const char *str, size_t n, void *dest)
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)
bool never_capture() const
static bool parse_null(const char *str, size_t n, void *dest)
std::once_flag group_names_once_
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
std::unique_ptr< Parser > parser_
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
void Copy(const Options &src)
grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:00