NCBI C++ ToolKit
|
Search Toolkit Book for CRegexp_loc
Class used to convert a PCRE match to a char* sequence into a CSeq_loc. More...
#include <algo/sequence/regexp_loc.hpp>
Public Member Functions | |
CRegexp_loc (const string &pat, CRegexp::TCompile flags=0) | |
Constructor for CRegexp_loc. More... | |
virtual | ~CRegexp_loc () |
void | Set (const string &pat, CRegexp::TCompile flags=0) |
Sets PCRE pattern. More... | |
TSeqPos | GetLoc (const char *seq, CSeq_loc *loc, TSeqPos offset=0, CRegexp::TMatch flags=0) |
Gets a CSeq_loc for PCRE match to char* sequence. More... | |
Private Member Functions | |
CRegexp_loc (const CRegexp_loc &) | |
void | operator= (const CRegexp_loc &) |
Private Attributes | |
unique_ptr< CRegexp > | m_regexp |
PCRE used to match against char* sequence passed as argument to GetLoc. More... | |
Class used to convert a PCRE match to a char* sequence into a CSeq_loc.
Definition at line 54 of file regexp_loc.hpp.
CRegexp_loc::CRegexp_loc | ( | const string & | pat, |
CRegexp::TCompile | flags = 0 |
||
) |
Constructor for CRegexp_loc.
Compiles the Perl Compatible Regular Expression (PCRE) pat, and sets compiled pattern options. See CRegexp.hpp for more information.
Definition at line 38 of file regexp_loc.cpp.
|
virtual |
Definition at line 43 of file regexp_loc.cpp.
|
private |
TSeqPos CRegexp_loc::GetLoc | ( | const char * | seq, |
CSeq_loc * | loc, | ||
TSeqPos | offset = 0 , |
||
CRegexp::TMatch | flags = 0 |
||
) |
Gets a CSeq_loc for PCRE match to char* sequence.
Gets a CSeq_loc (loc) of match between currently set regular expression and seq. Returned loc is of type CPacked_seqint. The first CSeq_interval in the CPacked_seqint is the overall match. Subsequent CSeq_intervals are matches to sub-patterns. Begins search of seq at 0 based offset. Returns 0 based position of first character in seq of match. If no match found, returns kInvalidSeqPos and loc is set to an empty packed-int type CSeq_loc. See CRegexp.hpp for information about flags.
Definition at line 52 of file regexp_loc.cpp.
References flags, i, kInvalidSeqPos, m_regexp, offset, CPacked_seqint_Base::Set(), CSeq_loc::SetPacked_int(), and si.
Referenced by GetLoc().
|
private |
void CRegexp_loc::Set | ( | const string & | pat, |
CRegexp::TCompile | flags = 0 |
||
) |
Sets PCRE pattern.
Sets and compiles Perl Compatible Regular Expression (PCRE) pat, and sets compiled pattern options. See CRegexp.hpp for more information.
Definition at line 47 of file regexp_loc.cpp.
|
private |
PCRE used to match against char* sequence passed as argument to GetLoc.
Definition at line 93 of file regexp_loc.hpp.