LSSTApplications  18.0.0+56,19.0.0+1,19.0.0+18,19.0.0+19,19.0.0+21,19.0.0+26,19.0.0+5,19.0.0-1-g20d9b18+12,19.0.0-1-g425ff20,19.0.0-1-g5549ca4,19.0.0-1-g580fafe+12,19.0.0-1-g6fe20d0+4,19.0.0-1-g8c57eb9+12,19.0.0-1-ga72da6b,19.0.0-1-gbfe0924+3,19.0.0-1-gdc0e4a7+17,19.0.0-1-ge272bc4+12,19.0.0-1-ge3aa853+3,19.0.0-16-g3a790c8c,19.0.0-18-g955d782+1,19.0.0-2-g0d9f9cd+19,19.0.0-2-g260436e+3,19.0.0-2-g9b11441+6,19.0.0-2-gd955cfd+25,19.0.0-3-g6513920+3,19.0.0-3-gc4f6e04+2,19.0.0-4-g41ffa1d+5,19.0.0-4-g725f80e+21,19.0.0-5-g0745e3f+3,19.0.0-6-g5a632bb5+1,19.0.0-6-gb6b8b0a+3,19.0.0-7-g686a884,19.0.0-7-gea0a0fe+8,19.0.0-9-gd2f60f3c3,w.2020.03
LSSTDataManagementBasePackage
Public Types | 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 Types

typedef std::shared_ptr< PolicyParserFactoryPtr
 

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::stringgetFormatName ()
 return the name for the format supported by the parser 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 const std::string UNRECOGNIZED
 an empty string representing an unrecognized format More...
 

Detailed Description

a class for creating PAFParser objects

Definition at line 53 of file PAFParserFactory.h.

Member Typedef Documentation

◆ Ptr

Definition at line 59 of file PolicyParserFactory.h.

Constructor & Destructor Documentation

◆ PAFParserFactory()

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.

64  : PolicyParserFactory(), contentid(contIdPatt) { }

Member Function Documentation

◆ createParser()

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.

◆ getFormatName()

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.

◆ isRecognized()

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

◆ CONTENTID

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.

◆ FORMAT_NAME

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

a name for the format

Definition at line 96 of file PAFParserFactory.h.

◆ LEADER_PATTERN

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.

◆ UNRECOGNIZED

const std::string lsst::pex::policy::PolicyParserFactory::UNRECOGNIZED
staticinherited

an empty string representing an unrecognized format

Definition at line 101 of file PolicyParserFactory.h.


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