lsst.pex.policy  14.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Static Public Attributes | List of all members
lsst::pex::policy::paf::PAFParserFactory Class Reference

a class for creating PAFParser objects More...

#include <PAFParserFactory.h>

Inheritance diagram for lsst::pex::policy::paf::PAFParserFactory:
lsst::pex::policy::PolicyParserFactory

Public Member Functions

 PAFParserFactory (const boost::regex &contIdPatt=CONTENTID)
 create a new factory More...
 
virtual PolicyParsercreateParser (Policy &policy, bool strict=true) const
 create a new PolicyParser class and return a pointer to it. More...
 
virtual bool isRecognized (const std::string &leaders) const
 analyze the given string assuming contains the leading characters from the data stream and return true if it is recognized as being in the format supported by this parser. More...
 
virtual const std::string & getFormatName ()
 return the name for the format supported by the parser More...
 
- Public Member Functions inherited from lsst::pex::policy::PolicyParserFactory
 PolicyParserFactory ()
 create a factory More...
 
virtual ~PolicyParserFactory ()
 destroy this factory More...
 

Static Public Attributes

static const std::string FORMAT_NAME
 a name for the format More...
 
static const boost::regex LEADER_PATTERN
 a pattern for the leading data characters for this format More...
 
static const boost::regex CONTENTID
 a default pattern for the content identifier. More...
 
- Static Public Attributes inherited from lsst::pex::policy::PolicyParserFactory
static const std::string UNRECOGNIZED
 an empty string representing an unrecognized format More...
 

Additional Inherited Members

- Public Types inherited from lsst::pex::policy::PolicyParserFactory
typedef std::shared_ptr
< PolicyParserFactory
Ptr
 

Detailed Description

a class for creating PAFParser objects

Definition at line 53 of file PAFParserFactory.h.

Constructor & Destructor Documentation

lsst::pex::policy::paf::PAFParserFactory::PAFParserFactory ( const boost::regex &  contIdPatt = CONTENTID)
inline

create a new factory

Parameters
contIdPattthe pattern to use for recognizing a content identifier. A content ID is encoded in a (#-leading) comment as the first line of the file. The default is "<?cfg JSON ... ?>"

Definition at line 63 of file PAFParserFactory.h.

Member Function Documentation

virtual PolicyParser* lsst::pex::policy::paf::PAFParserFactory::createParser ( Policy policy,
bool  strict = true 
) const
virtual

create a new PolicyParser class and return a pointer to it.

The caller is responsible for destroying the pointer.

Parameters
policythe Policy object that data should be loaded into.
strictif true (default), make the returned PolicyParser be strict in reporting errors in file contents and syntax. If false, errors will be ignored if possible; often, such errors will result in some data not getting loaded. The default (set by PolicyParser) is true.

Implements lsst::pex::policy::PolicyParserFactory.

virtual const std::string& lsst::pex::policy::paf::PAFParserFactory::getFormatName ( )
virtual

return the name for the format supported by the parser

Reimplemented from lsst::pex::policy::PolicyParserFactory.

virtual bool lsst::pex::policy::paf::PAFParserFactory::isRecognized ( const std::string &  leaders) const
virtual

analyze the given string assuming contains the leading characters from the data stream and return true if it is recognized as being in the format supported by this parser.

If it is, return the name of the this format;

Implements lsst::pex::policy::PolicyParserFactory.

Member Data Documentation

const boost::regex lsst::pex::policy::paf::PAFParserFactory::CONTENTID
static

a default pattern for the content identifier.

The content ID is encoded in a (#-leading) comment as the first line of the file. This default is "<?cfg PAF ... ?>"

Definition at line 108 of file PAFParserFactory.h.

const std::string lsst::pex::policy::paf::PAFParserFactory::FORMAT_NAME
static

a name for the format

Definition at line 96 of file PAFParserFactory.h.

const boost::regex lsst::pex::policy::paf::PAFParserFactory::LEADER_PATTERN
static

a pattern for the leading data characters for this format

Definition at line 101 of file PAFParserFactory.h.


The documentation for this class was generated from the following file: