Pol  Revision:4b29d2b
fileaccess.h
Go to the documentation of this file.
1 
7 #ifndef FILEACCESS_H
8 #define FILEACCESS_H
9 
10 #include "../../clib/maputil.h"
11 
12 #include <set>
13 #include <string>
14 #include <vector>
15 
16 namespace Pol
17 {
18 namespace Clib
19 {
20 class ConfigElem;
21 }
22 namespace Plib
23 {
24 class Package;
25 }
26 
27 namespace Module
28 {
30 {
31 public:
32  explicit FileAccess( Clib::ConfigElem& elem );
33  bool AllowsAccessTo( const Plib::Package* pkg, const Plib::Package* filepackage ) const;
34  bool AppliesToPackage( const Plib::Package* pkg ) const;
35  bool AppliesToPath( const std::string& path, const Plib::Package* filepkg ) const;
36  size_t estimateSize() const;
37 
38  bool AllowWrite;
40  bool AllowRead;
41 
43 
47 
48  std::set<const Plib::Package*> Packages;
49  std::vector<std::pair<const Plib::Package*, std::string>> Directories;
50  std::vector<std::string> Extensions;
51 };
52 
53 bool HasWriteAccess( const Plib::Package* pkg, const Plib::Package* filepackage,
54  const std::string& path );
55 }
56 }
57 #endif
bool HasWriteAccess(const Plib::Package *pkg, const Plib::Package *filepackage, const std::string &path)
Definition: filemod.cpp:267
std::vector< std::string > Extensions
Definition: fileaccess.h:50
std::set< const Plib::Package * > Packages
Definition: fileaccess.h:48
std::vector< std::pair< const Plib::Package *, std::string > > Directories
Definition: fileaccess.h:49
Definition: berror.cpp:12