CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
catalog::RelaxedPathFilter Class Reference

#include <relaxed_path_filter.h>

Inheritance diagram for catalog::RelaxedPathFilter:
Collaboration diagram for catalog::RelaxedPathFilter:

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 Rulespositive_rules () const
 
const Rulesnegative_rules () const
 
size_t RuleCount () const
 
size_t NegativeRuleCount () const
 
size_t PositiveRuleCount () const
 
bool IsValid () const
 

Static Public Member Functions

static RelaxedPathFilterCreate (const std::string &dirtab_path)
 
- Static Public Member Functions inherited from catalog::Dirtab
static DirtabCreate (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< RuleRules
 
- Static Public Attributes inherited from catalog::Dirtab
static const char kCommentMarker = '#'
 
static const char kNegationMarker = '!'
 

Detailed Description

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.

Member Function Documentation

RelaxedPathFilter * RelaxedPathFilter::Create ( const std::string &  dirtab_path)
static

Definition at line 12 of file relaxed_path_filter.cc.

Referenced by swissknife::CommandPull::Main().

Here is the call graph for this function:

Here is the caller graph for this function:

bool RelaxedPathFilter::IsMatching ( const std::string &  path) const
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.

Parameters
paththe path string to be matched against this Dirtab
Returns
true if path string is matching this Dirtab

Reimplemented from catalog::Dirtab.

Definition at line 19 of file relaxed_path_filter.cc.

Referenced by swissknife::CommandPull::Pull().

Here is the call graph for this function:

Here is the caller graph for this function:

bool RelaxedPathFilter::IsOpposing ( const std::string &  path) const
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.

Parameters
paththe path string to be checked for opposition of this Dirtab
Returns
true if (at least) one negative rule matches

Reimplemented from catalog::Dirtab.

Definition at line 37 of file relaxed_path_filter.cc.

Referenced by IsMatching().

Here is the call graph for this function:

Here is the caller graph for this function:

bool RelaxedPathFilter::Parse ( const std::string &  dirtab)
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.

Parameters
dirtaba string containing the full content of a .cvmfsdirtab file
Returns
true on successful parsing

Reimplemented from catalog::Dirtab.

Definition at line 54 of file relaxed_path_filter.cc.

Here is the call graph for this function:

bool RelaxedPathFilter::Parse ( FILE *  dirtab_file)
virtual

Reimplemented from catalog::Dirtab.

Definition at line 58 of file relaxed_path_filter.cc.

Here is the call graph for this function:

bool RelaxedPathFilter::ParsePathspec ( const std::string &  pathspec_str,
bool  negation 
)
protectedvirtual

Reimplemented from catalog::Dirtab.

Definition at line 66 of file relaxed_path_filter.cc.

Here is the call graph for this function:

Member Data Documentation

Dirtab catalog::RelaxedPathFilter::exact_dirtab_
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().


The documentation for this class was generated from the following files: