lsst.astshim g38293774b4+c9b10be330
Public Member Functions | List of all members
ast::XmlChan Class Reference

#include <XmlChan.h>

Inheritance diagram for ast::XmlChan:
ast::Channel ast::Object

Public Member Functions

 XmlChan (Stream &stream, std::string const &options="")
 
virtual ~XmlChan ()
 
 XmlChan (XmlChan const &)=delete
 
 XmlChan (XmlChan &&)=default
 
XmlChanoperator= (XmlChan const &)=delete
 
XmlChanoperator= (XmlChan &&)=default
 
std::string getXmlFormat () const
 Get XmlFormat System for formatting Objects as XML. More...
 
int getXmlLength () const
 Get XmlLength: controls output buffer length. More...
 
std::string getXmlPrefix ()
 Get XmlPrefix: the namespace prefix to use when writing. More...
 
void setXmlFormat (std::string const &format)
 Set XmlFormat System for formatting Objects as XML. More...
 
void setXmlLength (int len)
 Set XmlLength: controls output buffer length; 0 for no limit. More...
 
void setXmlPrefix (std::string const &prefix)
 Set XmlPrefix: the namespace prefix to use when writing. More...
 
- Public Member Functions inherited from ast::Channel
 Channel (Stream &stream, std::string const &options="")
 
virtual ~Channel ()
 
 Channel (Channel const &)=delete
 
 Channel (Channel &&)=default
 
Channeloperator= (Channel const &)=delete
 
Channeloperator= (Channel &&)=default
 
std::shared_ptr< Channelcopy () const
 Return a deep copy of this object. More...
 
bool getComment () const
 Get Comment: include textual comments in output? More...
 
int getFull () const
 Get Full: level of output detail; one of -1: minimum, 0: normal, 1: verbose. More...
 
int getIndent () const
 Get Indent: indentation increment between objects. More...
 
int getReportLevel () const
 Get ReportLevel: report level. More...
 
bool getSkip () const
 Get Skip: skip irrelevant data on input? More...
 
bool getStrict () const
 Get Strict: generate errors instead of warnings? More...
 
std::shared_ptr< Objectread ()
 Read an object from a channel. More...
 
void setComment (bool skip)
 Set Comment: include textual comments in output? More...
 
void setFull (int full)
 Set Full: level of output detail; one of -1: minimum, 0: normal, 1: verbose. More...
 
void setIndent (int indent)
 Set Indent: indentation increment between objects. More...
 
void setReportLevel (int level)
 
void setSkip (bool skip)
 Set Skip: skip irrelevant data on input? More...
 
void setStrict (bool strict)
 Set Strict: generate errors instead of warnings? More...
 
KeyMap warnings () const
 
int write (Object const &object)
 Write an object to a channel. More...
 
- Public Member Functions inherited from ast::Object
virtual ~Object ()
 
 Object (Object const &object)
 Copy constructor: make a deep copy. More...
 
 Object (Object &&)=default
 
Objectoperator= (Object const &)=delete
 
Objectoperator= (Object &&)=default
 
bool operator== (Object const &rhs) const
 
bool operator!= (Object const &rhs) const
 
std::shared_ptr< Objectcopy () const
 Return a deep copy of this object. More...
 
void clear (std::string const &attrib)
 
bool hasAttribute (std::string const &attrib) const
 
std::string getClassName () const
 
std::string getID () const
 Get ID: object identification string that is not copied. More...
 
std::string getIdent () const
 Get Ident: object identification string that is copied. More...
 
int getNObject () const
 
int getObjSize () const
 Get ObjSize: the in-memory size of the AST object in bytes. More...
 
int getRefCount () const
 
bool getUseDefs () const
 Get UseDefs: allow use of default values for Object attributes? More...
 
void lock (bool wait)
 
bool same (Object const &other) const
 
void setID (std::string const &id)
 Set ID: object identification string that is not copied. More...
 
void setIdent (std::string const &ident)
 Set Ident: object identification string that is copied. More...
 
void setUseDefs (bool usedefs)
 Set UseDefs: allow use of default values for Object attributes? More...
 
void show (std::ostream &os, bool showComments=true) const
 
std::string show (bool showComments=true) const
 
bool test (std::string const &attrib) const
 
void unlock (bool report=false)
 
AstObject const * getRawPtr () const
 
AstObject * getRawPtr ()
 

Additional Inherited Members

- Public Types inherited from ast::Object
using ObjectPtr = std::unique_ptr< AstObject, Deleter >
 unique pointer holding an AST raw pointer More...
 
- Static Public Member Functions inherited from ast::Object
static std::shared_ptr< ObjectfromString (std::string const &str)
 
template<typename Class >
static std::shared_ptr< Class > fromAstObject (AstObject *rawObj, bool copy)
 
- Protected Member Functions inherited from ast::Channel
virtual std::shared_ptr< ObjectcopyPolymorphic () const override
 
 Channel (AstChannel *chan, Stream &stream, bool isFits=false)
 
 Channel (AstChannel *chan)
 
- Protected Member Functions inherited from ast::Object
 Object (AstObject *object)
 
template<typename T , typename AstT >
std::shared_ptr< T > copyImpl () const
 
virtual std::shared_ptr< ObjectcopyPolymorphic () const =0
 
bool getB (std::string const &attrib) const
 
std::string const getC (std::string const &attrib) const
 
double getD (std::string const &attrib) const
 
float getF (std::string const &attrib) const
 
int getI (std::string const &attrib) const
 
long int getL (std::string const &attrib) const
 
void set (std::string const &setting)
 
void setB (std::string const &attrib, bool value)
 
void setC (std::string const &attrib, std::string const &value)
 
void setD (std::string const &attrib, double value)
 
void setF (std::string const &attrib, float value)
 
void setI (std::string const &attrib, int value)
 
void setL (std::string const &attrib, long int value)
 
- Static Protected Member Functions inherited from ast::Object
template<typename ShimT , typename AstT >
static std::shared_ptr< ShimT > makeShim (AstObject *p)
 

Detailed Description

XmlChan provides input/output of AST objects.

Writing an Object to a XmlChan will generate a textual representation of that Object, and reading from a XmlChan will create a new Object from its textual representation.

XmlChan provides the following attributes, in addition to those provided by Channel and Object

XmlFormat: system for formatting Objects as XML. XmlLength: controls output buffer length; 0 for no limit. XmlPrefix: the namespace prefix to use when writing.

Constructor & Destructor Documentation

◆ XmlChan() [1/3]

ast::XmlChan::XmlChan ( Stream stream,
std::string const &  options = "" 
)
inlineexplicit

Construct a channel that uses a provided Stream

Parameters
[in]streamStream for channel I/O:
  • For file I/O: provide a FileStream
  • For string I/O (e.g. unit tests): provide a StringStream
  • For standard I/O provide Stream(&std::cin, &std::cout)) where either stream can be nullptr if not wanted
[in]optionsComma-separated list of attribute assignments.

◆ ~XmlChan()

virtual ast::XmlChan::~XmlChan ( )
inlinevirtual

◆ XmlChan() [2/3]

ast::XmlChan::XmlChan ( XmlChan const &  )
delete

◆ XmlChan() [3/3]

ast::XmlChan::XmlChan ( XmlChan &&  )
default

Member Function Documentation

◆ getXmlFormat()

std::string ast::XmlChan::getXmlFormat ( ) const
inline

Get XmlFormat System for formatting Objects as XML.

◆ getXmlLength()

int ast::XmlChan::getXmlLength ( ) const
inline

Get XmlLength: controls output buffer length.

◆ getXmlPrefix()

std::string ast::XmlChan::getXmlPrefix ( )
inline

Get XmlPrefix: the namespace prefix to use when writing.

◆ operator=() [1/2]

XmlChan & ast::XmlChan::operator= ( XmlChan &&  )
default

◆ operator=() [2/2]

XmlChan & ast::XmlChan::operator= ( XmlChan const &  )
delete

◆ setXmlFormat()

void ast::XmlChan::setXmlFormat ( std::string const &  format)
inline

Set XmlFormat System for formatting Objects as XML.

◆ setXmlLength()

void ast::XmlChan::setXmlLength ( int  len)
inline

Set XmlLength: controls output buffer length; 0 for no limit.

◆ setXmlPrefix()

void ast::XmlChan::setXmlPrefix ( std::string const &  prefix)
inline

Set XmlPrefix: the namespace prefix to use when writing.


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