lsst.pex.policy  13.0-1-g47a359c+17
Public Member Functions | Protected Attributes | List of all members
lsst::pex::policy::paf::PAFWriter Class Reference

An abstract interface for writing policy data to streams. More...

#include <PAFWriter.h>

Inheritance diagram for lsst::pex::policy::paf::PAFWriter:
lsst::pex::policy::PolicyWriter

Public Member Functions

 PAFWriter (std::ostream *out=0)
 create a writer attached to an output stream More...
 
 PAFWriter (std::ostream *out, const std::string indent)
 create a writer attached to an output stream More...
 
virtual ~PAFWriter ()
 delete this writer More...
 
 PAFWriter (const std::string &file)
 create a writer attached to an output file More...
 
 PAFWriter (const char *file)
 create a writer attached to an output file More...
 
virtual void writeBools (const std::string &name, const Policy::BoolArray &values)
 write an array of property values with a given name More...
 
virtual void writeInts (const std::string &name, const Policy::IntArray &values)
 write an array of property values with a given name More...
 
virtual void writeDoubles (const std::string &name, const Policy::DoubleArray &values)
 write an array of property values with a given name More...
 
virtual void writeStrings (const std::string &name, const Policy::StringArray &values)
 write an array of property values with a given name More...
 
virtual void writePolicies (const std::string &name, const Policy::PolicyPtrArray &values)
 write an array of property values with a given name More...
 
virtual void writeFiles (const std::string &name, const Policy::FilePtrArray &values)
 write an array of property values with a given name More...
 
- Public Member Functions inherited from lsst::pex::policy::PolicyWriter
 PolicyWriter (std::ostream *out=0)
 create a writer attached to an output stream. More...
 
 PolicyWriter (const std::string &file, bool append=false)
 create a writer attached to a file. More...
 
virtual ~PolicyWriter ()
 delete this writer More...
 
virtual void write (const Policy &policy, bool doDecl=false)
 write the contents of a policy the attached stream. More...
 
void close ()
 close the output stream. More...
 
std::string toString ()
 return the written data as a string. More...
 
virtual void writeBool (const std::string &name, bool value)
 write the given property out as policy data More...
 
virtual void writeInt (const std::string &name, int value)
 write the given property out as policy data More...
 
virtual void writeDouble (const std::string &name, double value)
 write the given property out as policy data More...
 
virtual void writeString (const std::string &name, const std::string &value)
 write the given property out as policy data More...
 
virtual void writePolicy (const std::string &name, const Policy &value)
 write the given property out as policy data More...
 
virtual void writeFile (const std::string &name, const PolicyFile &value)
 write the given property out as policy data More...
 

Protected Attributes

std::string _indent
 the indentation string More...
 
- Protected Attributes inherited from lsst::pex::policy::PolicyWriter
std::ostream * _os
 the output stream. More...
 

Detailed Description

An abstract interface for writing policy data to streams.

Definition at line 44 of file PAFWriter.h.

Constructor & Destructor Documentation

◆ PAFWriter() [1/4]

lsst::pex::policy::paf::PAFWriter::PAFWriter ( std::ostream *  out = 0)
inlineexplicit

create a writer attached to an output stream

Parameters
outthe output stream to write data to

Definition at line 51 of file PAFWriter.h.

◆ PAFWriter() [2/4]

lsst::pex::policy::paf::PAFWriter::PAFWriter ( std::ostream *  out,
const std::string  indent 
)
inline

create a writer attached to an output stream

Parameters
outthe output stream to write data to
indenta string (of spaces) to used as indentation for each line printed out.

Definition at line 60 of file PAFWriter.h.

◆ PAFWriter() [3/4]

lsst::pex::policy::paf::PAFWriter::PAFWriter ( const std::string &  file)
inlineexplicit

create a writer attached to an output file

Parameters
filethe output file

Definition at line 69 of file PAFWriter.h.

◆ PAFWriter() [4/4]

lsst::pex::policy::paf::PAFWriter::PAFWriter ( const char *  file)
inlineexplicit

create a writer attached to an output file

Parameters
filethe output file

Definition at line 71 of file PAFWriter.h.

◆ ~PAFWriter()

virtual lsst::pex::policy::paf::PAFWriter::~PAFWriter ( )
virtual

delete this writer

Member Function Documentation

◆ writeBools()

virtual void lsst::pex::policy::paf::PAFWriter::writeBools ( const std::string &  name,
const Policy::BoolArray values 
)
virtual

write an array of property values with a given name

Parameters
namethe name to save the values as. This may be a hierarchical name; however, an implementation is not guaranteed to support it. If it cannot, it should raise an exception.
valuesthe values to save under that name.

Implements lsst::pex::policy::PolicyWriter.

◆ writeDoubles()

virtual void lsst::pex::policy::paf::PAFWriter::writeDoubles ( const std::string &  name,
const Policy::DoubleArray values 
)
virtual

write an array of property values with a given name

Parameters
namethe name to save the values as. This may be a hierarchical name; however, an implementation is not guaranteed to support it. If it cannot, it should raise an exception.
valuesthe values to save under that name.

Implements lsst::pex::policy::PolicyWriter.

◆ writeFiles()

virtual void lsst::pex::policy::paf::PAFWriter::writeFiles ( const std::string &  name,
const Policy::FilePtrArray values 
)
virtual

write an array of property values with a given name

Parameters
namethe name to save the values as. This may be a hierarchical name; however, an implementation is not guaranteed to support it. If it cannot, it should raise an exception.
valuesthe values to save under that name.

Implements lsst::pex::policy::PolicyWriter.

◆ writeInts()

virtual void lsst::pex::policy::paf::PAFWriter::writeInts ( const std::string &  name,
const Policy::IntArray values 
)
virtual

write an array of property values with a given name

Parameters
namethe name to save the values as. This may be a hierarchical name; however, an implementation is not guaranteed to support it. If it cannot, it should raise an exception.
valuesthe values to save under that name.

Implements lsst::pex::policy::PolicyWriter.

◆ writePolicies()

virtual void lsst::pex::policy::paf::PAFWriter::writePolicies ( const std::string &  name,
const Policy::PolicyPtrArray values 
)
virtual

write an array of property values with a given name

Parameters
namethe name to save the values as. This may be a hierarchical name; however, an implementation is not guaranteed to support it. If it cannot, it should raise an exception.
valuesthe values to save under that name.

Implements lsst::pex::policy::PolicyWriter.

◆ writeStrings()

virtual void lsst::pex::policy::paf::PAFWriter::writeStrings ( const std::string &  name,
const Policy::StringArray values 
)
virtual

write an array of property values with a given name

Parameters
namethe name to save the values as. This may be a hierarchical name; however, an implementation is not guaranteed to support it. If it cannot, it should raise an exception.
valuesthe values to save under that name.

Implements lsst::pex::policy::PolicyWriter.

Member Data Documentation

◆ _indent

std::string lsst::pex::policy::paf::PAFWriter::_indent
protected

the indentation string

Definition at line 108 of file PAFWriter.h.


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