lsst.pex.policy
20.0.0+38e2ebd2ba
|
Go to the documentation of this file.
44 using boost::regex_match;
45 using boost::regex_search;
63 : PolicySource(fmts), Persistable(), _data(), _pfact() {}
71 : PolicySource(fmts), Persistable(), _data(data), _pfact() {}
73 #define PolStr_ERROR_MSG(use, msg, input) \
74 std::ostringstream use; \
75 use << msg << ": '"; \
76 if (input.length() > 40) \
79 use << input.substr(0, 40) << "..."; \
92 PolStr_ERROR_MSG(msg,
"failure opening input Policy string",
_data);
104 PolStr_ERROR_MSG(msg,
"failure reading input Policy string",
_data);
112 return cacheName(
_formats->recognizeType(line));
124 if (!pfactory.get()) {
126 if (fmtname.empty()) {
127 PolStr_ERROR_MSG(ms,
"Unknown Policy format for string data",
_data);
130 pfactory =
_formats->getFactory(fmtname);
137 PolStr_ERROR_MSG(msg,
"failure opening Policy string",
_data);
definition of Policy-specific exceptions classes
std::shared_ptr< PolicyParserFactory > Ptr
definition of the PolicyParser class
static const boost::regex SPACE_RE
SupportedFormats::Ptr _formats
definition of the PolicyString class
definition of Policy parsing exceptions
definition of the PAFParserFactory class
static const boost::regex COMMENT
reg-exp for an empty line
definition of the PolicyFile class
T regex_search(T... args)
#define LSST_EXCEPT(type,...)
PolicyString(const std::string &data, const SupportedFormats::Ptr &fmts=defaultFormats)
create a PolicyString that's wrapped around a given string.
a class for creating PAFParser objects
std::string _data
the policy data
virtual void load(Policy &policy)
load the data from this Policy source into a Policy object
static const boost::regex CONTENTID
reg-exp for the start of a comment
static const std::string FORMAT_NAME
a name for the format
virtual const std::string & getFormatName()
return the name of the format that the data is stored in.