#include <AttrMatcher.h>
Public Types | |
enum | Mode { NOTHING, STRING, STRINGSTART, STRINGEND, SUBSTRING, GLOB, REGEX, OTHER } |
Mode flags (mutual exclusive). More... | |
Public Member Functions | |
Match () | |
Default ctor 0 or NOTHING. | |
Match (Mode val_r) | |
Ctor from Mode value. | |
Match (int val_r) | |
Just in case one needs it. | |
bool | test (const Match &rhs) const |
Test whether all of the rhs bits are set (same mode if rhs has one). | |
bool | testAnyOf (const Match &rhs) const |
Whether at least one of the rhs bits is set (or the same mode). | |
void | set (const Match &rhs) |
Set all of the rhs bits (setting a new mode if rhs has one). | |
void | unset (const Match &rhs) |
Unset all of the rhs bits (unsets mode if the same as rhs). | |
void | turn (const Match &rhs, bool onoff) |
Depending on the value of onoff, set or unset flags. | |
Match & | operator|= (const Match &rhs) |
Add flags. | |
Match & | operator-= (const Match &rhs) |
Remove flags. | |
Mode | mode () const |
Return the mode part. | |
Match | flags () const |
Return the flags part. | |
std::string | asString () const |
String representation. | |
Low level integer representation. | |
int | get () const |
Return the integer representation. | |
int | modeval () const |
Return the modes integer representation. | |
int | flagval () const |
Return the flags integer representation. | |
Mode flag manip/query convenience. | |
bool | isMode (Mode rhs) const |
Whether this has mode rhs. | |
bool | isModeString () const |
Whether this has mode STRING. | |
bool | isModeStringstart () const |
Whether this has mode STRINGSTART. | |
bool | isModeStringend () const |
Whether this has mode STRINGEND. | |
bool | isModeSubstring () const |
Whether this has mode SUBSTRING. | |
bool | isModeGlob () const |
Whether this has mode GLOB. | |
bool | isModeRegex () const |
Whether this has mode REGEX. | |
void | setMode (Mode rhs) |
Set the mode part to rhs . | |
void | setModeString () |
Set the mode STRING. | |
void | setModeStringstart () |
Set the mode STRINGSTART. | |
void | setModeStringend () |
Set the mode STRINGEND. | |
void | setModeSubstring () |
Set the mode SUBSTRING. | |
void | setModeGlob () |
Set the mode GLOB. | |
void | setModeRegex () |
Set the mode REGEX. | |
Static Public Attributes | |
Option flags | |
Some flags are actually sat::LookupAttr specific, as they tell how to retrieve the attribute values.
The plain sat::AttrMatcher will ignore those flags and use the ones related to string matching only (like NOCASE). | |
static const Match | NOCASE |
If set, match case insensitive. | |
static const Match | NO_STORAGE_SOLVABLE |
internal | |
static const Match | SUB |
internal | |
static const Match | ARRAYSENTINEL |
internal | |
static const Match | SKIP_KIND |
If set, skip any kind: prefix when looking at a Solvable name. | |
static const Match | FILES |
If set, match full path when matching in filelists, otherwise just the basenames. | |
Private Member Functions | |
friend | base::SafeBool () const |
bool | boolTest () const |
Static Private Member Functions | |
static int | modeval (Mode mode_r) |
Numeric value for enum (short for Match(m).get() ). | |
Private Attributes | |
int | _val |
Static Private Attributes | |
static const int | _modemask = SEARCH_STRINGMASK |
static const int | _flagmask = ~_modemask |
Related Functions | |
(Note that these are not member functions.) | |
bool | operator== (const Match &lhs, const Match &rhs) |
bool | operator!= (const Match &lhs, const Match &rhs) |
Match | operator| (const Match &lhs, const Match &rhs) |
Match | operator| (Match::Mode lhs, Match::Mode rhs) |
Match | operator- (const Match &lhs, const Match &rhs) |
Match | operator- (Match::Mode lhs, Match::Mode rhs) |
std::ostream & | operator<< (std::ostream &str, const Match &obj) |
by sat::AttrMatcher.
Match mode( Match::GLOB | Match::NOCASE );
Definition at line 41 of file AttrMatcher.h.
enum zypp::Match::Mode |
zypp::Match::Match | ( | ) | [inline] |
zypp::Match::Match | ( | Mode | val_r | ) | [inline] |
zypp::Match::Match | ( | int | val_r | ) | [inline, explicit] |
bool zypp::Match::test | ( | const Match & | rhs | ) | const [inline] |
Test whether all
of the rhs bits are set (same mode if rhs has one).
Definition at line 105 of file AttrMatcher.h.
bool zypp::Match::testAnyOf | ( | const Match & | rhs | ) | const [inline] |
Whether at least one of the rhs bits is set (or the same mode).
Definition at line 110 of file AttrMatcher.h.
void zypp::Match::set | ( | const Match & | rhs | ) | [inline] |
Set all of the rhs bits (setting a new mode if rhs has one).
Definition at line 115 of file AttrMatcher.h.
void zypp::Match::unset | ( | const Match & | rhs | ) | [inline] |
Unset all of the rhs bits (unsets mode if the same as rhs).
Definition at line 124 of file AttrMatcher.h.
References _val, flagval(), and modeval().
Referenced by operator-=(), and turn().
void zypp::Match::turn | ( | const Match & | rhs, | |
bool | onoff | |||
) | [inline] |
Depending on the value of onoff, set or unset flags.
Definition at line 133 of file AttrMatcher.h.
References unset().
Match::Mode zypp::Match::mode | ( | ) | const |
Return the mode
part.
Definition at line 50 of file AttrMatcher.cc.
References GLOB, modeval(), NOTHING, OTHER, REGEX, STRING, STRINGEND, STRINGSTART, and SUBSTRING.
Referenced by zypp::PoolQuery::Impl::compile(), zypp::PoolQuery::matchMode(), and zypp::operator<<().
Match zypp::Match::flags | ( | ) | const [inline] |
int zypp::Match::get | ( | ) | const [inline] |
Return the integer representation.
Definition at line 156 of file AttrMatcher.h.
References _val.
Referenced by zypp::sat::LookupAttr::Impl::begin(), operator!=(), zypp::sat::operator<(), and operator==().
int zypp::Match::modeval | ( | ) | const [inline] |
Return the modes integer representation.
Definition at line 158 of file AttrMatcher.h.
References _modemask, and _val.
Referenced by isMode(), mode(), zypp::operator<<(), setMode(), test(), testAnyOf(), and unset().
int zypp::Match::flagval | ( | ) | const [inline] |
Return the flags integer representation.
Definition at line 160 of file AttrMatcher.h.
References _flagmask, and _val.
Referenced by flags(), zypp::operator<<(), set(), setMode(), test(), testAnyOf(), and unset().
bool zypp::Match::isMode | ( | Mode | rhs | ) | const [inline] |
Whether this has mode rhs.
Definition at line 167 of file AttrMatcher.h.
References modeval().
Referenced by isModeGlob(), isModeRegex(), isModeString(), isModeStringend(), isModeStringstart(), and isModeSubstring().
bool zypp::Match::isModeString | ( | ) | const [inline] |
Whether this has mode STRING.
Definition at line 170 of file AttrMatcher.h.
References isMode(), and STRING.
Referenced by zypp::PoolQuery::Impl::createRegex(), and zypp::PoolQuery::Impl::operator==().
bool zypp::Match::isModeStringstart | ( | ) | const [inline] |
Whether this has mode STRINGSTART.
Definition at line 173 of file AttrMatcher.h.
References isMode(), and STRINGSTART.
bool zypp::Match::isModeStringend | ( | ) | const [inline] |
bool zypp::Match::isModeSubstring | ( | ) | const [inline] |
bool zypp::Match::isModeGlob | ( | ) | const [inline] |
Whether this has mode GLOB.
Definition at line 182 of file AttrMatcher.h.
References GLOB, and isMode().
Referenced by zypp::PoolQuery::Impl::createRegex(), and zypp::PoolQuery::Impl::operator==().
bool zypp::Match::isModeRegex | ( | ) | const [inline] |
void zypp::Match::setMode | ( | Mode | rhs | ) | [inline] |
Set the mode part to rhs .
Definition at line 189 of file AttrMatcher.h.
References _val, flagval(), and modeval().
Referenced by setModeGlob(), setModeRegex(), setModeString(), setModeStringend(), setModeStringstart(), and setModeSubstring().
void zypp::Match::setModeString | ( | ) | [inline] |
void zypp::Match::setModeStringstart | ( | ) | [inline] |
Set the mode STRINGSTART.
Definition at line 195 of file AttrMatcher.h.
References setMode(), and STRINGSTART.
void zypp::Match::setModeStringend | ( | ) | [inline] |
void zypp::Match::setModeSubstring | ( | ) | [inline] |
void zypp::Match::setModeGlob | ( | ) | [inline] |
void zypp::Match::setModeRegex | ( | ) | [inline] |
Set the mode REGEX.
Definition at line 207 of file AttrMatcher.h.
References REGEX, and setMode().
Referenced by zypp::PoolQuery::Impl::compile().
std::string zypp::Match::asString | ( | ) | const |
zypp::Match::base::SafeBool | ( | ) | const [private] |
bool zypp::Match::boolTest | ( | ) | const [inline, private] |
int zypp::Match::modeval | ( | Mode | mode_r | ) | [static, private] |
Definition at line 233 of file AttrMatcher.h.
Match operator| | ( | Match::Mode | lhs, | |
Match::Mode | rhs | |||
) | [related] |
Definition at line 236 of file AttrMatcher.h.
Definition at line 240 of file AttrMatcher.h.
Match operator- | ( | Match::Mode | lhs, | |
Match::Mode | rhs | |||
) | [related] |
Definition at line 243 of file AttrMatcher.h.
std::ostream & operator<< | ( | std::ostream & | str, | |
const Match & | obj | |||
) | [related] |
Stream output
Definition at line 102 of file AttrMatcher.cc.
const int zypp::Match::_modemask = SEARCH_STRINGMASK [static, private] |
const int zypp::Match::_flagmask = ~_modemask [static, private] |
const Match zypp::Match::NOCASE [static] |
If set, match case insensitive.
Definition at line 69 of file AttrMatcher.h.
Referenced by zypp::PoolQuery::caseSensitive(), zypp::operator<<(), and zypp::PoolQuery::setCaseSensitive().
const Match zypp::Match::NO_STORAGE_SOLVABLE [static] |
const Match zypp::Match::SUB [static] |
const Match zypp::Match::ARRAYSENTINEL [static] |
const Match zypp::Match::SKIP_KIND [static] |
If set, skip any kind:
prefix when looking at a Solvable name.
Definition at line 77 of file AttrMatcher.h.
Referenced by zypp::operator<<().
const Match zypp::Match::FILES [static] |
If set, match full path when matching in filelists, otherwise just the basenames.
Definition at line 79 of file AttrMatcher.h.
Referenced by zypp::PoolQuery::filesMatchFullPath(), zypp::operator<<(), and zypp::PoolQuery::setFilesMatchFullPath().
int zypp::Match::_val [private] |
Definition at line 222 of file AttrMatcher.h.
Referenced by boolTest(), flagval(), get(), modeval(), set(), setMode(), and unset().