pcrecpp::RE Class Reference

#include <pcrecpp.h>

List of all members.

Public Types

enum  Anchor

Public Member Functions

 RE (const string &pat)
 RE (const string &pat, const RE_Options &option)
 RE (const char *pat)
 RE (const char *pat, const RE_Options &option)
 RE (const unsigned char *pat)
 RE (const unsigned char *pat, const RE_Options &option)
 RE (const RE &re)
const REoperator= (const RE &re)
 ~RE ()
const stringpattern () const
const stringerror () const
bool FullMatch (const StringPiece &text, const Arg &ptr1=no_arg, const Arg &ptr2=no_arg, const Arg &ptr3=no_arg, const Arg &ptr4=no_arg, const Arg &ptr5=no_arg, const Arg &ptr6=no_arg, const Arg &ptr7=no_arg, const Arg &ptr8=no_arg, const Arg &ptr9=no_arg, const Arg &ptr10=no_arg, const Arg &ptr11=no_arg, const Arg &ptr12=no_arg, const Arg &ptr13=no_arg, const Arg &ptr14=no_arg, const Arg &ptr15=no_arg, const Arg &ptr16=no_arg) const
bool PartialMatch (const StringPiece &text, const Arg &ptr1=no_arg, const Arg &ptr2=no_arg, const Arg &ptr3=no_arg, const Arg &ptr4=no_arg, const Arg &ptr5=no_arg, const Arg &ptr6=no_arg, const Arg &ptr7=no_arg, const Arg &ptr8=no_arg, const Arg &ptr9=no_arg, const Arg &ptr10=no_arg, const Arg &ptr11=no_arg, const Arg &ptr12=no_arg, const Arg &ptr13=no_arg, const Arg &ptr14=no_arg, const Arg &ptr15=no_arg, const Arg &ptr16=no_arg) const
bool Consume (StringPiece *input, const Arg &ptr1=no_arg, const Arg &ptr2=no_arg, const Arg &ptr3=no_arg, const Arg &ptr4=no_arg, const Arg &ptr5=no_arg, const Arg &ptr6=no_arg, const Arg &ptr7=no_arg, const Arg &ptr8=no_arg, const Arg &ptr9=no_arg, const Arg &ptr10=no_arg, const Arg &ptr11=no_arg, const Arg &ptr12=no_arg, const Arg &ptr13=no_arg, const Arg &ptr14=no_arg, const Arg &ptr15=no_arg, const Arg &ptr16=no_arg) const
bool FindAndConsume (StringPiece *input, const Arg &ptr1=no_arg, const Arg &ptr2=no_arg, const Arg &ptr3=no_arg, const Arg &ptr4=no_arg, const Arg &ptr5=no_arg, const Arg &ptr6=no_arg, const Arg &ptr7=no_arg, const Arg &ptr8=no_arg, const Arg &ptr9=no_arg, const Arg &ptr10=no_arg, const Arg &ptr11=no_arg, const Arg &ptr12=no_arg, const Arg &ptr13=no_arg, const Arg &ptr14=no_arg, const Arg &ptr15=no_arg, const Arg &ptr16=no_arg) const
bool Replace (const StringPiece &rewrite, string *str) const
int GlobalReplace (const StringPiece &rewrite, string *str) const
bool Extract (const StringPiece &rewrite, const StringPiece &text, string *out) const
bool DoMatch (const StringPiece &text, Anchor anchor, int *consumed, const Arg *const *args, int n) const
int NumberOfCapturingGroups () const

Static Public Member Functions

static string QuoteMeta (const StringPiece &unquoted)

Static Public Attributes

static Arg no_arg

Private Member Functions

void Init (const string &pattern, const RE_Options *options)
void Cleanup ()
int TryMatch (const StringPiece &text, int startpos, Anchor anchor, int *vec, int vecsize) const
bool Rewrite (string *out, const StringPiece &rewrite, const StringPiece &text, int *vec, int veclen) const
bool DoMatchImpl (const StringPiece &text, Anchor anchor, int *consumed, const Arg *const args[], int n, int *vec, int vecsize) const
pcreCompile (Anchor anchor)

Private Attributes

string pattern_
RE_Options options_
pcrere_full_
pcrere_partial_
const stringerror_


Detailed Description

Definition at line 487 of file pcrecpp.h.


Member Enumeration Documentation

enum pcrecpp::RE::Anchor

Definition at line 632 of file pcrecpp.h.


Constructor & Destructor Documentation

pcrecpp::RE::RE ( const string pat  )  [inline]

Definition at line 491 of file pcrecpp.h.

References Init(), and NULL.

pcrecpp::RE::RE ( const string pat,
const RE_Options option 
) [inline]

Definition at line 492 of file pcrecpp.h.

References Init(), and option.

pcrecpp::RE::RE ( const char *  pat  )  [inline]

Definition at line 493 of file pcrecpp.h.

References Init(), and NULL.

pcrecpp::RE::RE ( const char *  pat,
const RE_Options option 
) [inline]

Definition at line 494 of file pcrecpp.h.

References Init(), and option.

pcrecpp::RE::RE ( const unsigned char *  pat  )  [inline]

Definition at line 495 of file pcrecpp.h.

References Init(), and NULL.

pcrecpp::RE::RE ( const unsigned char *  pat,
const RE_Options option 
) [inline]

Definition at line 498 of file pcrecpp.h.

References Init(), and option.

pcrecpp::RE::RE ( const RE re  )  [inline]

Definition at line 504 of file pcrecpp.h.

References Init(), options_, and pattern_.

pcrecpp::RE::~RE (  ) 

Definition at line 106 of file pcrecpp.cc.

References Cleanup().


Member Function Documentation

const RE& pcrecpp::RE::operator= ( const RE re  )  [inline]

Definition at line 505 of file pcrecpp.h.

References Init(), options_, and pattern_.

const string& pcrecpp::RE::pattern (  )  const [inline]

Definition at line 524 of file pcrecpp.h.

Referenced by main().

const string& pcrecpp::RE::error (  )  const [inline]

Definition at line 528 of file pcrecpp.h.

Referenced by main(), and TestReplace().

bool pcrecpp::RE::FullMatch ( const StringPiece text,
const Arg ptr1 = no_arg,
const Arg ptr2 = no_arg,
const Arg ptr3 = no_arg,
const Arg ptr4 = no_arg,
const Arg ptr5 = no_arg,
const Arg ptr6 = no_arg,
const Arg ptr7 = no_arg,
const Arg ptr8 = no_arg,
const Arg ptr9 = no_arg,
const Arg ptr10 = no_arg,
const Arg ptr11 = no_arg,
const Arg ptr12 = no_arg,
const Arg ptr13 = no_arg,
const Arg ptr14 = no_arg,
const Arg ptr15 = no_arg,
const Arg ptr16 = no_arg 
) const

Definition at line 151 of file pcrecpp.cc.

References ANCHOR_BOTH, DoMatchImpl(), pcrecpp::kMaxArgs, pcrecpp::kVecSize, n, no_arg, ptr1, ptr2, and text().

Referenced by main(), NegativeTestQuoteMeta(), TestConstructors(), TestQuoteMeta(), TestRecursion(), Timing1(), and Timing2().

bool pcrecpp::RE::PartialMatch ( const StringPiece text,
const Arg ptr1 = no_arg,
const Arg ptr2 = no_arg,
const Arg ptr3 = no_arg,
const Arg ptr4 = no_arg,
const Arg ptr5 = no_arg,
const Arg ptr6 = no_arg,
const Arg ptr7 = no_arg,
const Arg ptr8 = no_arg,
const Arg ptr9 = no_arg,
const Arg ptr10 = no_arg,
const Arg ptr11 = no_arg,
const Arg ptr12 = no_arg,
const Arg ptr13 = no_arg,
const Arg ptr14 = no_arg,
const Arg ptr15 = no_arg,
const Arg ptr16 = no_arg 
) const

Definition at line 193 of file pcrecpp.cc.

References DoMatchImpl(), pcrecpp::kMaxArgs, pcrecpp::kVecSize, n, no_arg, ptr1, ptr2, text(), and UNANCHORED.

Referenced by main(), and TestRecursion().

bool pcrecpp::RE::Consume ( StringPiece input,
const Arg ptr1 = no_arg,
const Arg ptr2 = no_arg,
const Arg ptr3 = no_arg,
const Arg ptr4 = no_arg,
const Arg ptr5 = no_arg,
const Arg ptr6 = no_arg,
const Arg ptr7 = no_arg,
const Arg ptr8 = no_arg,
const Arg ptr9 = no_arg,
const Arg ptr10 = no_arg,
const Arg ptr11 = no_arg,
const Arg ptr12 = no_arg,
const Arg ptr13 = no_arg,
const Arg ptr14 = no_arg,
const Arg ptr15 = no_arg,
const Arg ptr16 = no_arg 
) const

Definition at line 235 of file pcrecpp.cc.

References ANCHOR_START, DoMatchImpl(), pcrecpp::kMaxArgs, pcrecpp::kVecSize, n, no_arg, ptr1, and ptr2.

Referenced by pcrecpp::Scanner::Consume(), pcrecpp::Scanner::ConsumeSkip(), and Timing3().

bool pcrecpp::RE::FindAndConsume ( StringPiece input,
const Arg ptr1 = no_arg,
const Arg ptr2 = no_arg,
const Arg ptr3 = no_arg,
const Arg ptr4 = no_arg,
const Arg ptr5 = no_arg,
const Arg ptr6 = no_arg,
const Arg ptr7 = no_arg,
const Arg ptr8 = no_arg,
const Arg ptr9 = no_arg,
const Arg ptr10 = no_arg,
const Arg ptr11 = no_arg,
const Arg ptr12 = no_arg,
const Arg ptr13 = no_arg,
const Arg ptr14 = no_arg,
const Arg ptr15 = no_arg,
const Arg ptr16 = no_arg 
) const

Definition at line 283 of file pcrecpp.cc.

References DoMatchImpl(), pcrecpp::kMaxArgs, pcrecpp::kVecSize, n, no_arg, ptr1, ptr2, and UNANCHORED.

bool pcrecpp::RE::Replace ( const StringPiece rewrite,
string str 
) const

Definition at line 331 of file pcrecpp.cc.

References pcrecpp::kVecSize, Rewrite(), s, str, TryMatch(), and UNANCHORED.

int pcrecpp::RE::GlobalReplace ( const StringPiece rewrite,
string str 
) const

Definition at line 380 of file pcrecpp.cc.

References pcrecpp::RE_Options::all_options(), pcrecpp::kVecSize, pcrecpp::NewlineMode(), options_, out, PCRE_NEWLINE_ANY, PCRE_NEWLINE_ANYCRLF, PCRE_NEWLINE_CRLF, Rewrite(), start, str, ROOT::Math::swap(), TryMatch(), UNANCHORED, and pcrecpp::RE_Options::utf8().

Referenced by TestReplace().

bool pcrecpp::RE::Extract ( const StringPiece rewrite,
const StringPiece text,
string out 
) const

Definition at line 441 of file pcrecpp.cc.

References pcrecpp::kVecSize, out, Rewrite(), text(), TryMatch(), and UNANCHORED.

Referenced by Test_NO_AUTO_CAPTURE().

string pcrecpp::RE::QuoteMeta ( const StringPiece unquoted  )  [static]

Definition at line 452 of file pcrecpp.cc.

References result(), and pcrecpp::StringPiece::size().

bool pcrecpp::RE::DoMatch ( const StringPiece text,
Anchor  anchor,
int *  consumed,
const Arg *const *  args,
int  n 
) const

Referenced by pcrecpp::Scanner::LookingAt().

int pcrecpp::RE::NumberOfCapturingGroups (  )  const

Definition at line 623 of file pcrecpp.cc.

References NULL, pcre_fullinfo(), PCRE_INFO_CAPTURECOUNT, re_partial_, and result().

void pcrecpp::RE::Init ( const string pattern,
const RE_Options options 
) [private]

Definition at line 82 of file pcrecpp.cc.

References ANCHOR_BOTH, Compile(), pcrecpp::default_options, pcrecpp::empty_string, error_, NULL, options_, pattern_, re_full_, re_partial_, and UNANCHORED.

void pcrecpp::RE::Cleanup (  )  [private]

Definition at line 99 of file pcrecpp.cc.

References pcrecpp::empty_string, error_, NULL, re_full_, and re_partial_.

Referenced by ~RE().

int pcrecpp::RE::TryMatch ( const StringPiece text,
int  startpos,
Anchor  anchor,
int *  vec,
int  vecsize 
) const [private]

Definition at line 488 of file pcrecpp.cc.

References ANCHOR_BOTH, extra, pcrecpp::RE_Options::match_limit(), pcrecpp::RE_Options::match_limit_recursion(), NULL, options_, PCRE_ANCHORED, PCRE_ERROR_NOMATCH, pcre_exec(), PCRE_EXTRA_MATCH_LIMIT, PCRE_EXTRA_MATCH_LIMIT_RECURSION, re_full_, re_partial_, text(), and UNANCHORED.

Referenced by Extract(), GlobalReplace(), and Replace().

bool pcrecpp::RE::Rewrite ( string out,
const StringPiece rewrite,
const StringPiece text,
int *  vec,
int  veclen 
) const [private]

Definition at line 590 of file pcrecpp.cc.

References c, pcrecpp::StringPiece::data(), out, s, pcrecpp::StringPiece::size(), start, and text().

Referenced by Extract(), GlobalReplace(), and Replace().

bool pcrecpp::RE::DoMatchImpl ( const StringPiece text,
Anchor  anchor,
int *  consumed,
const Arg *const  args[],
int  n,
int *  vec,
int  vecsize 
) const [private]

Referenced by Consume(), FindAndConsume(), FullMatch(), and PartialMatch().

pcre * pcrecpp::RE::Compile ( Anchor  anchor  )  [private]

Definition at line 111 of file pcrecpp.cc.

References pcrecpp::RE_Options::all_options(), ANCHOR_BOTH, pcrecpp::empty_string, error_, NULL, options_, pattern_, and pcre_compile().

Referenced by Init().


Member Data Documentation

Arg pcrecpp::RE::no_arg [static]

Definition at line 650 of file pcrecpp.h.

Referenced by Consume(), FindAndConsume(), FullMatch(), and PartialMatch().

string pcrecpp::RE::pattern_ [private]

Definition at line 694 of file pcrecpp.h.

Referenced by Compile(), Init(), operator=(), and RE().

RE_Options pcrecpp::RE::options_ [private]

Definition at line 695 of file pcrecpp.h.

Referenced by Compile(), GlobalReplace(), Init(), operator=(), RE(), and TryMatch().

pcre* pcrecpp::RE::re_full_ [private]

Definition at line 696 of file pcrecpp.h.

Referenced by Cleanup(), Init(), and TryMatch().

pcre* pcrecpp::RE::re_partial_ [private]

Definition at line 697 of file pcrecpp.h.

Referenced by Cleanup(), Init(), NumberOfCapturingGroups(), and TryMatch().

const string* pcrecpp::RE::error_ [private]

Definition at line 698 of file pcrecpp.h.

Referenced by Cleanup(), Compile(), and Init().


The documentation for this class was generated from the following files:
Generated on Tue Jul 5 16:56:30 2011 for ROOT_528-00b_version by  doxygen 1.5.1