27 #include "lsst/pex/exceptions.h"
33 namespace fs = boost::filesystem;
34 namespace pexExcept = lsst::pex::exceptions;
41 const std::string& filepath,
42 const std::string& repos,
47 if (repos.length() > 0) _repos /= repos;
48 _file = _repos / filepath;
65 std::string productName_DIR(productName);
68 std::transform(productName_DIR.begin(), productName_DIR.end(),
69 productName_DIR.begin(),
70 std::ptr_fun<int, int>( std::toupper ));
73 productName_DIR +=
"_DIR";
76 const char *ipath = getenv(productName_DIR.c_str());
78 throw LSST_EXCEPT(pexExcept::NotFoundError,
79 productName_DIR +
": environment variable not set");
81 return fs::path(ipath);
the definition of the DefaultPolicyFile class
a container for holding hierarchical configuration data in memory.
DefaultPolicyFile(const char *const productName, const std::string &filepath, const std::string &repos="", bool strict=true)
define a default policy file
virtual void load(Policy &policy) const
load the data from this Policy source into a Policy object
static boost::filesystem::path installPathFor(const char *const productName)
return the file path to the installation directory of a given named product.
virtual void load(Policy &policy) const
load the data from this Policy source into a Policy object.
int loadPolicyFiles(bool strict=true)
Recursively replace all PolicyFile values with the contents of the files they refer to...
a representation of a file containing Policy parameter data.
boost::filesystem::path _file
the path to the underlying policy file
virtual boost::filesystem::path getInstallPath(const char *const productName)
return the file path to the installation directory of a given named product.