polserver/pol-core/pol/module/fileaccess.h
turleypol dbb25bdb62
Include and buildsystem cleanup (#45)
Include cleanup
Reworked buildsystem (Linux only)
Removed dynamic libs, Linux now again uses static linking (like windows)
2018-01-29 21:55:48 +01:00

57 lines
1 KiB
C++

/** @file
*
* @par History
*/
#ifndef FILEACCESS_H
#define FILEACCESS_H
#include "../../clib/maputil.h"
#include <set>
#include <string>
#include <vector>
namespace Pol
{
namespace Clib
{
class ConfigElem;
}
namespace Plib
{
class Package;
}
namespace Module
{
class FileAccess
{
public:
explicit FileAccess( Clib::ConfigElem& elem );
bool AllowsAccessTo( const Plib::Package* pkg, const Plib::Package* filepackage ) const;
bool AppliesToPackage( const Plib::Package* pkg ) const;
bool AppliesToPath( const std::string& path, const Plib::Package* filepkg ) const;
size_t estimateSize() const;
bool AllowWrite;
bool AllowAppend;
bool AllowRead;
bool AllowRemote;
bool AllPackages;
bool AllDirectories;
bool AllExtensions;
std::set<const Plib::Package*> Packages;
std::vector<std::pair<const Plib::Package*, std::string>> Directories;
std::vector<std::string> Extensions;
};
bool HasWriteAccess( const Plib::Package* pkg, const Plib::Package* filepackage,
const std::string& path );
}
}
#endif