57      case SEARCH_STRING:       
return STRING;            
break;
 
   59      case SEARCH_STRINGEND:    
return STRINGEND;      
break;
 
   60      case SEARCH_SUBSTRING:    
return SUBSTRING;      
break;
 
   61      case SEARCH_GLOB:         
return GLOB;                
break;
 
   62      case SEARCH_REGEX:        
return REGEX;              
break;
 
 
   72      case STRING:        
return SEARCH_STRING;           
break;
 
   74      case STRINGEND:  
return SEARCH_STRINGEND;        
break;
 
   75      case SUBSTRING:  
return SEARCH_SUBSTRING;        
break;
 
   76      case GLOB:    
return SEARCH_GLOB;             
break;
 
   77      case REGEX:  
return SEARCH_REGEX;            
break;
 
   78      case OTHER:  
return SEARCH_STRINGMASK;       
break;
 
   80    return SEARCH_STRINGMASK;
 
 
   84  { std::ostringstream 
str; 
str << *
this; 
return str.str(); }
 
 
   90#define OUTS(V) case Match::V: return str << #V; break 
  101    return str << 
"Match::Mode::UNKNOWN";
 
 
  107      return str << 
"NOTHING";
 
  109    const char * sep = 
"|";
 
  127#define OUTS(V) if ( val & Match::V.get() ) { val &= ~Match::V.get(); if ( sep ) str << sep; else sep = "|"; str << #V; } 
  140        if ( sep ) 
str << sep;
 
 
  153                                  : 
str::
form(
_(
"Unknown match mode '%s' for pattern '%s'"), mode_r.
asString().c_str(), msg_r.c_str() ) )
 
 
  157  : 
MatchException( regcomp_r ? 
str::
form(
_(
"Invalid regular expression '%s': regcomp returned %d"), regex_r.c_str(), regcomp_r )
 
  158                              : 
str::
form(
_(
"Invalid regular expression '%s'"), regex_r.c_str() ) )
 
 
  215      return ::datamatcher_match( 
_matcher.get(), string_r );
 
 
  239        ::datamatcher_free( 
_matcher.get() );
 
 
 
  298  { 
return _pimpl->compile(); }
 
 
  301  { 
return _pimpl->isCompiled(); }
 
 
  304  { 
return _pimpl->doMatch( string_r ); }
 
 
  307  { 
return _pimpl->searchstring(); }
 
 
  310  { 
_pimpl->setSearchstring( string_r ); }
 
 
  312  { 
_pimpl->setSearchstring( std::move(string_r) ); }
 
 
  316    _pimpl->setSearchstring( string_r );
 
  317    _pimpl->setFlags( flags_r );
 
 
  321    _pimpl->setSearchstring( std::move(string_r) );
 
  322    _pimpl->setFlags( flags_r );
 
 
  326  { 
return _pimpl->flags(); }
 
 
  329  { 
_pimpl->setFlags( flags_r ); }
 
 
String matching option flags as used e.g.
static const Match DISABLED_REPOS
LookupAttr: internal.
int flagval() const
Return the flags integer representation.
Match()
Default ctor 0 or NOTHING.
int get() const
Return the integer representation.
std::string asString() const
String representation.
static const Match ARRAYSENTINEL
LookupAttr: internal.
static const Match SUB
LookupAttr: internal.
Mode
Mode flags (mutual exclusive).
@ STRINGEND
Match at string end.
@ REGEX
Regular Expression.
@ STRINGSTART
Match at string start.
@ SUBSTRING
Match substring.
static const Match COMPLETE_FILELIST
LookupAttr: internal.
static const Match CHECKSUMS
LookupAttr: also look for matches in checksums.
static const int _flagmask
static const Match NO_STORAGE_SOLVABLE
LookupAttr: internal.
static const Match FILES
LookupAttr: match full path when matching in filelists, otherwise just the basenames.
static const Match SKIP_KIND
LookupAttr: skip any kind: prefix when looking at a Solvable name.
static const Match NOCASE
If set, match case insensitive.
int modeval() const
Return the modes integer representation.
static const int _modemask
Mode mode() const
Return the mode part.
bool doMatch(const char *string_r) const
Return whether string matches.
const std::string & searchstring() const
The current searchstring.
const Match & flags() const
The current search flags.
RWCOW_pointer< Impl > _pimpl
Pointer to implementation.
StrMatcher()
Default ctor matches nothing.
void setSearchstring(const std::string &string_r)
Set a new searchstring.
void setFlags(const Match &flags_r)
Set new search flags.
bool isCompiled() const
Whether the StrMatcher is already compiled.
void compile() const
Compile the pattern e.g.
String related utilities and Regular expression matching.
::s_Datamatcher CDatamatcher
Wrapped libsolv C data type exposed as backdoor.
std::string hexstring(char n, int w=4)
Easy-to use interface to the ZYPP dependency resolver.
bool operator<(const StrMatcher &lhs, const StrMatcher &rhs)
bool operator==(const SetRelation::Enum &lhs, const SetCompare &rhs)
This is an overloaded member function, provided for convenience. It differs from the above function o...
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
std::string asString(const Patch::Category &obj)
MatchException(const std::string &msg_r)
Supplied message.
Invalid regular expression (failed ::regcomp).
MatchInvalidRegexException(const std::string &msg_r)
Supplied message.
MatchUnknownModeException(const std::string &msg_r)
Supplied message.
StrMatcher implementation.
Impl * clone() const
clone for RWCOW_pointer
const Match & flags() const
The current search flags.
Impl & operator=(Impl &&)=delete
const std::string & searchstring() const
The current searchstring.
friend Impl * rwcowClone(const Impl *rhs)
void compile() const
Compile the pattern.
bool isCompiled() const
Whether the pattern is already compiled.
bool doMatch(const char *string_r) const
Return whether string matches.
void invalidate()
Has to be called if _search or _flags change.
void setSearchstring(std::string string_r)
Set a new searchstring.
std::ostream & operator<<(std::ostream &str, const StrMatcher::Impl &obj)
Stream output.
Impl & operator=(const Impl &)=delete
Impl(std::string search_r, const Match &flags_r)
void setFlags(const Match &flags_r)
Set new search flags.
Impl(const Impl &)=delete
scoped_ptr< sat::detail::CDatamatcher > _matcher
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.