46 using boost::regex_match;
47 using boost::regex_search;
65 : PolicySource(fmts), Persistable(), _data(), _pfact()
75 : PolicySource(fmts), Persistable(), _data(data), _pfact()
78 #define PolStr_ERROR_MSG(use, msg, input) \ 79 std::ostringstream use; \ 80 use << msg << ": '"; \ 81 if (input.length() > 40) \ 84 use << input.substr(0,40) << "..."; \ 98 PolStr_ERROR_MSG(msg,
"failure opening input Policy string",
_data);
111 PolStr_ERROR_MSG(msg,
"failure reading input Policy string",
_data);
121 return cacheName(
_formats->recognizeType(line));
134 if (! pfactory.get()) {
136 if (fmtname.empty()) {
137 PolStr_ERROR_MSG(ms,
"Unknown Policy format for string data",
_data);
140 pfactory =
_formats->getFactory(fmtname);
147 PolStr_ERROR_MSG(msg,
"failure opening Policy string",
_data);
definition of the PolicyParser class
definition of the PolicyFile class
static const boost::regex CONTENTID
reg-exp for the start of a comment
a class for creating PAFParser objects
definition of Policy parsing exceptions
std::shared_ptr< PolicyParserFactory > Ptr
static const std::string FORMAT_NAME
a name for the format
virtual void load(Policy &policy)
load the data from this Policy source into a Policy object
static const boost::regex COMMENT
reg-exp for an empty line
Reports errors in external input/output operations.
static const boost::regex SPACE_RE
definition of the PAFParserFactory class
A base class for image defects.
definition of Policy-specific exceptions classes
PolicyString(const std::string &data, const SupportedFormats::Ptr &fmts=defaultFormats)
create a PolicyString that's wrapped around a given string.
virtual const std::string & getFormatName()
return the name of the format that the data is stored in.
def line(points, frame=None, origin=afwImage.PARENT, symbs=False, ctype=None, size=0.5)
SupportedFormats::Ptr _formats
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
T regex_search(T... args)
std::string _data
the policy data
definition of the PolicyString class