36 #ifndef LSST_PEX_POLICY_FILE_H
37 #define LSST_PEX_POLICY_FILE_H
40 #include <boost/regex.hpp>
41 #include <boost/filesystem/path.hpp>
42 #include <boost/filesystem/operations.hpp>
46 #include "lsst/daf/base/Persistable.h"
76 explicit PolicyFile(
const std::string& filepath,
80 explicit PolicyFile(
const boost::filesystem::path& filepath,
97 PolicyFile(
const boost::filesystem::path& filepath,
122 const boost::filesystem::path& reposDir,
124 PolicyFile(
const boost::filesystem::path& filepath,
125 const boost::filesystem::path& reposDir,
146 const boost::filesystem::path& reposDir,
148 PolicyFile(
const boost::filesystem::path& filepath,
149 const boost::filesystem::path& reposDir,
229 const std::string& cacheName(
const std::string& name) {
243 #endif // LSST_PEX_POLICY_FILE_H
definition of the PolicySource class
static const std::string EXT_PAF
static const boost::regex CONTENTID
reg-exp for the start of a comment
a container for holding hierarchical configuration data in memory.
virtual void load(Policy &policy) const
load the data from this Policy source into a Policy object
const std::string getPath() const
return the file path as a string
virtual void load(Policy &policy)
load the data from this Policy source into a Policy object
std::shared_ptr< PolicyParserFactory > Ptr
an abstract class representing a source of serialized Policy parameter data.
bool exists() const
return true if the file exists.
static SupportedFormats::Ptr defaultFormats
returns true if the given string containing a content identifier indicates that it contains dictionar...
PolicyFile(const std::string &filepath, const SupportedFormats::Ptr &fmts=defaultFormats)
create a Policy file that points a file with given path.
virtual const std::string & getFormatName()
return the name of the format that the data is stored in.
static const boost::regex SPACE_RE
the XML file extension, ".xml"
a representation of a file containing Policy parameter data.
static const std::string EXT_XML
the PAF file extension, ".paf"
boost::filesystem::path _file
the path to the underlying policy file
static const boost::regex COMMENT
reg-exp for an empty line
const std::string & getFormatName() const