CernVM-FS
2.12.0
|
#include <relaxed_path_filter.h>
Public Member Functions | |
virtual bool | Parse (const std::string &dirtab) |
virtual bool | Parse (FILE *dirtab_file) |
virtual bool | IsMatching (const std::string &path) const |
virtual bool | IsOpposing (const std::string &path) const |
Public Member Functions inherited from catalog::Dirtab | |
Dirtab () | |
virtual | ~Dirtab () |
const Rules & | positive_rules () const |
const Rules & | negative_rules () const |
size_t | RuleCount () const |
size_t | NegativeRuleCount () const |
size_t | PositiveRuleCount () const |
bool | IsValid () const |
Static Public Member Functions | |
static RelaxedPathFilter * | Create (const std::string &dirtab_path) |
Static Public Member Functions inherited from catalog::Dirtab | |
static Dirtab * | Create (const std::string &dirtab_path) |
Protected Member Functions | |
virtual bool | ParsePathspec (const std::string &pathspec_str, bool negation) |
Protected Member Functions inherited from catalog::Dirtab | |
bool | Open (const std::string &dirtab_path) |
bool | ParseLine (const std::string &line) |
void | AddRule (const Rule &rule) |
Private Attributes | |
Dirtab | exact_dirtab_ |
Additional Inherited Members | |
Public Types inherited from catalog::Dirtab | |
typedef std::vector< Rule > | Rules |
Static Public Attributes inherited from catalog::Dirtab | |
static const char | kCommentMarker = '#' |
static const char | kNegationMarker = '!' |
A RelaxedPathFilter works similar to a Dirtab but it matches more generously: in addition to the actual paths it represents, all parent paths are matched. Sub paths of given paths are matched, too. In contrast to Dirtab, trailing slashes of path specifications are ignored.
For instance: /software/releases ! /software/releases/misc ! /software/releases/experimental/misc
Results in the following positive matches /software, /software/releases, /software/releases/v1, /software/releases/experimental and in the following non-matches /software/apps, /software/releases/misc, /software/releases/misc/external, /software/releases/experimental/misc, /software/releases/experimental/misc/foo
It is used by cvmfs_preload as a specification of a partial subtree for synchronization with a cache directory.
Definition at line 36 of file relaxed_path_filter.h.
|
static |
Definition at line 12 of file relaxed_path_filter.cc.
Referenced by swissknife::CommandPull::Main().
|
virtual |
Matches a given path string against this Dirtab. The path is considered a match if it matches against (at least) one positive rule and is not matched by any negative rule.
path | the path string to be matched against this Dirtab |
Reimplemented from catalog::Dirtab.
Definition at line 19 of file relaxed_path_filter.cc.
Referenced by swissknife::CommandPull::Pull().
|
virtual |
Matches a given path string against all negative rules in this Dirtab. This bypasses the check for positive rules, thus a path string can be opposed by this Dirtab while it would also not match any positive rule.
path | the path string to be checked for opposition of this Dirtab |
Reimplemented from catalog::Dirtab.
Definition at line 37 of file relaxed_path_filter.cc.
Referenced by IsMatching().
|
virtual |
Parses the content of a .cvmfsdirtab file. This is called by the filepath- constructor or can be used on an empty Dirtab for testing purposes and in inherited classes.
dirtab | a string containing the full content of a .cvmfsdirtab file |
Reimplemented from catalog::Dirtab.
Definition at line 54 of file relaxed_path_filter.cc.
|
virtual |
Reimplemented from catalog::Dirtab.
Definition at line 58 of file relaxed_path_filter.cc.
|
protectedvirtual |
Reimplemented from catalog::Dirtab.
Definition at line 66 of file relaxed_path_filter.cc.
|
private |
Represents the entries in the provided dirtab file without parent paths. It is necessary to match sub paths against the provided dirtab.
Definition at line 52 of file relaxed_path_filter.h.
Referenced by IsMatching(), and Parse().