LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
lsst::pex::policy::paf::PAFParser Class Reference

a parser for reading PAF-formatted data into a Policy object More...

#include <PAFParser.h>

Inheritance diagram for lsst::pex::policy::paf::PAFParser:
lsst::pex::policy::PolicyParser lsst::daf::base::Citizen

Public Member Functions

 PAFParser (Policy &policy)
 
 PAFParser (Policy &policy, bool strict)
 
virtual ~PAFParser ()
 
virtual int parse (std::istream &is)
 
- Public Member Functions inherited from lsst::pex::policy::PolicyParser
 PolicyParser (Policy &policy, bool strict=true)
 
virtual ~PolicyParser ()
 
bool isStrict ()
 
void setStrict (bool strict)
 
PolicygetPolicy ()
 
const PolicygetPolicy () const
 
- Public Member Functions inherited from lsst::daf::base::Citizen
 Citizen (const std::type_info &)
 
 Citizen (Citizen const &)
 
 ~Citizen ()
 
Citizenoperator= (Citizen const &)
 
std::string repr () const
 Return a string representation of a Citizen. More...
 
void markPersistent (void)
 Mark a Citizen as persistent and not destroyed until process end. More...
 
memId getId () const
 Return the Citizen's ID. More...
 

Private Member Functions

std::ios::iostate _nextLine (std::istream &is, std::string &line)
 
void _pushBackLine (const std::string &line)
 
int _parseIntoPolicy (std::istream &is, Policy &policy)
 
int _addValue (const std::string &propname, std::string &value, Policy &policy, std::istream &is)
 

Private Attributes

std::list< std::string > _buffer
 
int _lineno
 
int _depth
 

Static Private Attributes

static const boost::regex COMMENT_LINE
 
static const boost::regex EMPTY_LINE
 
static const boost::regex SPACE_SRCH
 
static const boost::regex PARAM_SRCH
 
static const boost::regex NAME_MTCH
 
static const boost::regex OPEN_SRCH
 
static const boost::regex CLOSE_SRCH
 
static const boost::regex DOUBLE_VALUE
 
static const boost::regex INT_VALUE
 
static const boost::regex ATRUE_VALUE
 
static const boost::regex AFALSE_VALUE
 
static const boost::regex QQSTRING_VALUE
 
static const boost::regex QSTRING_VALUE
 
static const boost::regex QQSTRING_START
 
static const boost::regex QSTRING_START
 
static const boost::regex QQSTRING_EMPTYSTART
 
static const boost::regex QSTRING_EMPTYSTART
 
static const boost::regex QQSTRING_END
 
static const boost::regex QSTRING_END
 
static const boost::regex BARE_STRING_LINE
 
static const boost::regex BARE_STRING
 
static const boost::regex URN_VALUE
 
static const boost::regex FILE_VALUE
 

Additional Inherited Members

- Public Types inherited from lsst::daf::base::Citizen
enum  { magicSentinel = 0xdeadbeef }
 
typedef unsigned long memId
 Type of the block's ID. More...
 
typedef memId(* memNewCallback )(const memId cid)
 A function used to register a callback. More...
 
typedef memId(* memCallback )(const Citizen *ptr)
 
- Static Public Member Functions inherited from lsst::daf::base::Citizen
static bool hasBeenCorrupted ()
 Check all allocated blocks for corruption. More...
 
static memId getNextMemId ()
 Return the memId of the next object to be allocated. More...
 
static int init ()
 Called once when the memory system is being initialised. More...
 
static int census (int, memId startingMemId=0)
 How many active Citizens are there? More...
 
static void census (std::ostream &stream, memId startingMemId=0)
 Print a list of all active Citizens to stream, sorted by ID. More...
 
static const std::vector
< const Citizen * > * 
census ()
 Return a (newly allocated) std::vector of active Citizens sorted by ID. More...
 
static memId setNewCallbackId (memId id)
 Call the NewCallback when block is allocated. More...
 
static memId setDeleteCallbackId (memId id)
 Call the current DeleteCallback when block is deleted. More...
 
static memNewCallback setNewCallback (memNewCallback func)
 Set the NewCallback function. More...
 
static memCallback setDeleteCallback (memCallback func)
 Set the DeleteCallback function. More...
 
static memCallback setCorruptionCallback (memCallback func)
 Set the CorruptionCallback function. More...
 
- Protected Attributes inherited from lsst::pex::policy::PolicyParser
Policy_pol
 
bool _strict
 

Detailed Description

a parser for reading PAF-formatted data into a Policy object

Definition at line 54 of file PAFParser.h.

Constructor & Destructor Documentation

lsst::pex::policy::paf::PAFParser::PAFParser ( Policy policy)

create a parser to load a Policy

Parameters
policythe Policy object to load the parsed data into
lsst::pex::policy::paf::PAFParser::PAFParser ( Policy policy,
bool  strict 
)

create a parser to load a Policy

Parameters
policythe Policy object to load the parsed data into
strictif true, 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.
virtual lsst::pex::policy::paf::PAFParser::~PAFParser ( )
virtual

delete this parser

Member Function Documentation

int lsst::pex::policy::paf::PAFParser::_addValue ( const std::string &  propname,
std::string &  value,
Policy policy,
std::istream &  is 
)
private
std::ios::iostate lsst::pex::policy::paf::PAFParser::_nextLine ( std::istream &  is,
std::string &  line 
)
private
int lsst::pex::policy::paf::PAFParser::_parseIntoPolicy ( std::istream &  is,
Policy policy 
)
private
void lsst::pex::policy::paf::PAFParser::_pushBackLine ( const std::string &  line)
private
virtual int lsst::pex::policy::paf::PAFParser::parse ( std::istream &  is)
virtual

parse the data found on the given stream

Parameters
isthe stream to read PAF-encoded data from
Returns
int the number of parameters values loaded. This does not include sub-Policy objects.

Implements lsst::pex::policy::PolicyParser.

Member Data Documentation

std::list<std::string> lsst::pex::policy::paf::PAFParser::_buffer
private

Definition at line 122 of file PAFParser.h.

int lsst::pex::policy::paf::PAFParser::_depth
private

Definition at line 124 of file PAFParser.h.

int lsst::pex::policy::paf::PAFParser::_lineno
private

Definition at line 123 of file PAFParser.h.

const boost::regex lsst::pex::policy::paf::PAFParser::AFALSE_VALUE
staticprivate

Definition at line 107 of file PAFParser.h.

const boost::regex lsst::pex::policy::paf::PAFParser::ATRUE_VALUE
staticprivate

Definition at line 106 of file PAFParser.h.

const boost::regex lsst::pex::policy::paf::PAFParser::BARE_STRING
staticprivate

Definition at line 117 of file PAFParser.h.

const boost::regex lsst::pex::policy::paf::PAFParser::BARE_STRING_LINE
staticprivate

Definition at line 116 of file PAFParser.h.

const boost::regex lsst::pex::policy::paf::PAFParser::CLOSE_SRCH
staticprivate

Definition at line 103 of file PAFParser.h.

const boost::regex lsst::pex::policy::paf::PAFParser::COMMENT_LINE
staticprivate

Definition at line 97 of file PAFParser.h.

const boost::regex lsst::pex::policy::paf::PAFParser::DOUBLE_VALUE
staticprivate

Definition at line 104 of file PAFParser.h.

const boost::regex lsst::pex::policy::paf::PAFParser::EMPTY_LINE
staticprivate

Definition at line 98 of file PAFParser.h.

const boost::regex lsst::pex::policy::paf::PAFParser::FILE_VALUE
staticprivate

Definition at line 119 of file PAFParser.h.

const boost::regex lsst::pex::policy::paf::PAFParser::INT_VALUE
staticprivate

Definition at line 105 of file PAFParser.h.

const boost::regex lsst::pex::policy::paf::PAFParser::NAME_MTCH
staticprivate

Definition at line 101 of file PAFParser.h.

const boost::regex lsst::pex::policy::paf::PAFParser::OPEN_SRCH
staticprivate

Definition at line 102 of file PAFParser.h.

const boost::regex lsst::pex::policy::paf::PAFParser::PARAM_SRCH
staticprivate

Definition at line 100 of file PAFParser.h.

const boost::regex lsst::pex::policy::paf::PAFParser::QQSTRING_EMPTYSTART
staticprivate

Definition at line 112 of file PAFParser.h.

const boost::regex lsst::pex::policy::paf::PAFParser::QQSTRING_END
staticprivate

Definition at line 114 of file PAFParser.h.

const boost::regex lsst::pex::policy::paf::PAFParser::QQSTRING_START
staticprivate

Definition at line 110 of file PAFParser.h.

const boost::regex lsst::pex::policy::paf::PAFParser::QQSTRING_VALUE
staticprivate

Definition at line 108 of file PAFParser.h.

const boost::regex lsst::pex::policy::paf::PAFParser::QSTRING_EMPTYSTART
staticprivate

Definition at line 113 of file PAFParser.h.

const boost::regex lsst::pex::policy::paf::PAFParser::QSTRING_END
staticprivate

Definition at line 115 of file PAFParser.h.

const boost::regex lsst::pex::policy::paf::PAFParser::QSTRING_START
staticprivate

Definition at line 111 of file PAFParser.h.

const boost::regex lsst::pex::policy::paf::PAFParser::QSTRING_VALUE
staticprivate

Definition at line 109 of file PAFParser.h.

const boost::regex lsst::pex::policy::paf::PAFParser::SPACE_SRCH
staticprivate

Definition at line 99 of file PAFParser.h.

const boost::regex lsst::pex::policy::paf::PAFParser::URN_VALUE
staticprivate

Definition at line 118 of file PAFParser.h.


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