Alps/Parser Library
Summary
| Members | Descriptions |
|---|---|
namespace alps | |
namespace alps::detail | |
namespace alps::xml | |
namespace std |
namespace alps
Members
public std::string parse_identifier(std::istream & in)
reads an XML tag or attribute name from a std::istream
public std::string parse_parameter_name(std::istream & in)
reads an ALPS parameter name from a std::istream
valid characters, in addition to those in an XML identifier are ', and additionally any arbitrary sequence of characters (including whitespace) surrounded by ``[ … \ ] characters, such as in MEASURE[Staggered Magnetization^2] .
public std::string read_until(std::istream & in,char end)
reads until the next occurence of the character end or until the end of the stream is reached.
Parameters
inthe stream to be readendthe character until which should be read
Returns
string containing the characters read, excluding leading and trailing whitespace and excluding the terminating character end.
public ALPS_DECL void check_character(std::istream & in,char c,const std::string & err)
checks that the next character read from the stream.
Parameters
inthe stream to be readcthe character that should be readerrthe error message to be used if the next character is not c.
Exceptions
c std::runtime_error( err``) if the next character is not c reads the next character (slipping white space) and checks if it is the same as the character passed as argument c and throws a std::runtime_error otherwise.
public XMLTag parse_tag(std::istream & in,bool skip_comments)
parses an XML tag
Parameters
inthe stream to be readskip_commentsif true, the function skips any comments or processing instructions while parsing
Returns
an [XMLTag](#df/df1/structalps_1_1_x_m_l_tag) structure containing information about the tag
public std::string parse_content(std::istream & in)
reads the contents of an element, until the first < character found
public void skip_element(std::istream & in,const XMLTag & tag)
skips an XML element
Parameters
inthe stream to be readtagthe opening tag of the element to be skipped the function reads until it finds the closing tag correesponding to the tag passed as argument.
public void check_tag(std::istream & in,const std::string & name)
checks whether the next tag in the XML file has the given name
Parameters
inthe stream to be readnamethe name of the expected tag
Exceptions
c std::runtime_error if the next tag read from the stream in does not have the name given by the argument name.
public std::string convert(const std::string & str)
public inline detail::header_t header(const std::string & enc)
public inline detail::stylesheet_t stylesheet(const std::string & url)
public inline detail::pi_t processing_instruction(const std::string & name)
public inline detail::start_tag_t start_tag(const std::string & name)
public inline detail::end_tag_t end_tag(const std::string & name)
public template<>
inline detail::attribute_t attribute(const std::string & name,const T & value)
public inline detail::attribute_t xml_namespace(const std::string & name,const std::string & url)
public inline oxstream&start_comment(oxstream & oxs)
public inline oxstream&end_comment(oxstream & oxs)
public inline oxstream&start_cdata(oxstream & oxs)
public inline oxstream&end_cdata(oxstream & oxs)
public inline oxstream&no_linebreak(oxstream & oxs)
public template<>
inline std::string precision(const T & d,int n)
public ALPS_DECL std::string xslt_path(const std::string & stylefile)
given the name of an XSLT file, return the full path
The default behavior is to just return the file name
If the environment variable ALPS_XSLT_PATH is set, the contents of ALPS_XSLT_PATH are used instead of the default path.
public ALPS_DECL std::string search_xml_library_path(const std::string & file)
returns the full path to the specified XML file and checks whether the file exists.
The function prepends the path to the ALPS XML/XSLT library directory to the specified filename.
Exceptions
c std::runtime_error if the file does not exist in the ALPS XML/XSLT library directory.
public ALPS_DECL void copy_stylesheet(boost::filesystem::path const & dir)
copies the ALPS.xsl stylesheet to the specifeid directory
This function copies the ALPS.xsl stylesheet to the specified directory. The function does not overwrite an already existing file with the name ALPS.xsl
class alps::CompositeXMLHandler
class alps::CompositeXMLHandler
: public alps::XMLHandlerBaseSummary
| Members | Descriptions |
|---|---|
public inline CompositeXMLHandler(const std::string & basename) | |
public inline virtual ~CompositeXMLHandler() | |
public inline void clear_handler() | |
public void add_handler(XMLHandlerBase & handler) | |
public bool has_handler(const XMLHandlerBase & handler) const | |
public bool has_handler(const std::string & name) const | |
public virtual void start_element(const std::string & name,const XMLAttributes & attributes,xml::tag_type type) | |
public virtual void end_element(const std::string & name,xml::tag_type type) | |
public virtual void text(const std::string & text) | |
protected inline virtual void start_top(const std::string &,const XMLAttributes &,xml::tag_type) | |
protected inline virtual void end_top(const std::string &,xml::tag_type) | |
protected inline virtual void start_child(const std::string &,const XMLAttributes &,xml::tag_type) | |
protected inline virtual void end_child(const std::string &,xml::tag_type) | |
protected inline virtual bool start_element_impl(const std::string &,const XMLAttributes &,xml::tag_type) | |
protected inline virtual bool end_element_impl(const std::string &,xml::tag_type) | |
protected inline virtual bool text_impl(const std::string &) |
Members
public inline CompositeXMLHandler(const std::string & basename)
public inline virtual ~CompositeXMLHandler()
public inline void clear_handler()
public void add_handler(XMLHandlerBase & handler)
public bool has_handler(const XMLHandlerBase & handler) const
public bool has_handler(const std::string & name) const
public virtual void start_element(const std::string & name,const XMLAttributes & attributes,xml::tag_type type)
public virtual void end_element(const std::string & name,xml::tag_type type)
public virtual void text(const std::string & text)
protected inline virtual void start_top(const std::string &,const XMLAttributes &,xml::tag_type)
protected inline virtual void end_top(const std::string &,xml::tag_type)
protected inline virtual void start_child(const std::string &,const XMLAttributes &,xml::tag_type)
protected inline virtual void end_child(const std::string &,xml::tag_type)
protected inline virtual bool start_element_impl(const std::string &,const XMLAttributes &,xml::tag_type)
protected inline virtual bool end_element_impl(const std::string &,xml::tag_type)
protected inline virtual bool text_impl(const std::string &)
class alps::DummyXMLHandler
class alps::DummyXMLHandler
: public alps::XMLHandlerBaseSummary
| Members | Descriptions |
|---|---|
public inline DummyXMLHandler(const std::string & basename) | |
public inline virtual void start_element(const std::string &,const XMLAttributes &,xml::tag_type) | |
public inline virtual void end_element(const std::string &,xml::tag_type) | |
public inline virtual void text(const std::string &) |
Members
public inline DummyXMLHandler(const std::string & basename)
public inline virtual void start_element(const std::string &,const XMLAttributes &,xml::tag_type)
public inline virtual void end_element(const std::string &,xml::tag_type)
public inline virtual void text(const std::string &)
class alps::oxstream
Summary
| Members | Descriptions |
|---|---|
public oxstream() | |
public oxstream(std::ostream & os,uint32_t incr) | |
public oxstream(const boost::filesystem::path & file,uint32_t incr) | |
public ~oxstream() | |
public oxstream&operator<<(const detail::header_t & c) | |
public oxstream&operator<<(const detail::start_tag_t & c) | |
public oxstream&operator<<(const detail::end_tag_t & c) | |
public oxstream&operator<<(const detail::stylesheet_t & c) | |
public oxstream&operator<<(const detail::attribute_t & c) | |
public oxstream&operator<<(const detail::pi_t & c) | |
public oxstream&start_comment() | |
public oxstream&end_comment() | |
public oxstream&start_cdata() | |
public oxstream&end_cdata() | |
public oxstream&no_linebreak() | |
public inline oxstream&endl() | |
public oxstream&operator<<(const XMLAttribute & c) | |
public oxstream&operator<<(const XMLAttributes & c) | |
public inline oxstream&operator<<(const std::string & t) | |
public inline oxstream&operator<<(const char t) | |
public inline oxstream&operator<<(const char * t) | |
public template<>inline oxstream&operator<<(const std::complex< T > & t) | |
public template<>inline oxstream&operator<<(T(*)(const std::string &) fn) | |
public inline oxstream&operator<<(oxstream](#df/daf/classalps_1_1oxstream) &(*)([oxstream &oxs) fn) | |
public inline std::ostream & stream() | |
protected oxstream&text_str(const std::string & text) | |
protected void output(bool close) | |
protected void output_offset() |
Members
public oxstream()
public oxstream(std::ostream & os,uint32_t incr)
public oxstream(const boost::filesystem::path & file,uint32_t incr)
public ~oxstream()
public oxstream&operator<<(const detail::header_t & c)
public oxstream&operator<<(const detail::start_tag_t & c)
public oxstream&operator<<(const detail::end_tag_t & c)
public oxstream&operator<<(const detail::stylesheet_t & c)
public oxstream&operator<<(const detail::attribute_t & c)
public oxstream&operator<<(const detail::pi_t & c)
public oxstream&start_comment()
public oxstream&end_comment()
public oxstream&start_cdata()
public oxstream&end_cdata()
public oxstream&no_linebreak()
public inline oxstream&endl()
public oxstream&operator<<(const XMLAttribute & c)
public oxstream&operator<<(const XMLAttributes & c)
public inline oxstream&operator<<(const std::string & t)
public inline oxstream&operator<<(const char t)
public inline oxstream&operator<<(const char * t)
public template<>
inline oxstream&operator<<(const std::complex< T > & t)
public template<>
inline oxstream&operator<<(T(*)(const std::string &) fn)
public inline oxstream&operator<<(oxstream](#df/daf/classalps_1_1oxstream) &(*)([oxstream &oxs) fn)
public inline std::ostream & stream()
protected oxstream&text_str(const std::string & text)
protected void output(bool close)
protected void output_offset()
class alps::PrintXMLHandler
class alps::PrintXMLHandler
: public alps::XMLHandlerBaseSummary
| Members | Descriptions |
|---|---|
public inline PrintXMLHandler(std::ostream & os) | |
public inline virtual void start_element(const std::string & name,const XMLAttributes & attributes,xml::tag_type type) | |
public inline virtual void end_element(const std::string & name,xml::tag_type type) | |
public inline virtual void text(const std::string & text) |
Members
public inline PrintXMLHandler(std::ostream & os)
public inline virtual void start_element(const std::string & name,const XMLAttributes & attributes,xml::tag_type type)
public inline virtual void end_element(const std::string & name,xml::tag_type type)
public inline virtual void text(const std::string & text)
class alps::SimpleXMLHandler
class alps::SimpleXMLHandler
: public alps::XMLHandlerBaseSummary
| Members | Descriptions |
|---|---|
public inline SimpleXMLHandler(const std::string & basename,T & val,const std::string & attr) | |
public inline virtual ~SimpleXMLHandler() | |
public inline virtual void start_element(const std::string & name,const XMLAttributes & attributes,xml::tag_type type) | |
public inline virtual void end_element(const std::string & name,xml::tag_type type) | |
public inline virtual void text(const std::string & text) | |
typedef value_type |
Members
public inline SimpleXMLHandler(const std::string & basename,T & val,const std::string & attr)
public inline virtual ~SimpleXMLHandler()
public inline virtual void start_element(const std::string & name,const XMLAttributes & attributes,xml::tag_type type)
public inline virtual void end_element(const std::string & name,xml::tag_type type)
public inline virtual void text(const std::string & text)
typedef value_type
class alps::StylesheetXMLHandler
class alps::StylesheetXMLHandler
: public alps::XMLHandlerBaseSummary
| Members | Descriptions |
|---|---|
public inline StylesheetXMLHandler(std::string & style) | |
public inline virtual void start_element(const std::string &,const XMLAttributes & attributes,xml::tag_type type) | |
public inline virtual void end_element(const std::string &,xml::tag_type) | |
public inline virtual void text(const std::string &) |
Members
public inline StylesheetXMLHandler(std::string & style)
public inline virtual void start_element(const std::string &,const XMLAttributes & attributes,xml::tag_type type)
public inline virtual void end_element(const std::string &,xml::tag_type)
public inline virtual void text(const std::string &)
class alps::VectorXMLHandler
class alps::VectorXMLHandler
: public alps::CompositeXMLHandlerSummary
| Members | Descriptions |
|---|---|
public inline VectorXMLHandler(const std::string & basename,C & cont,T & val,H & handler) | |
public inline virtual ~VectorXMLHandler() | |
protected inline virtual void end_child(const std::string & name,xml::tag_type type) |
Members
public inline VectorXMLHandler(const std::string & basename,C & cont,T & val,H & handler)
public inline virtual ~VectorXMLHandler()
protected inline virtual void end_child(const std::string & name,xml::tag_type type)
class alps::XMLAttribute
Summary
| Members | Descriptions |
|---|---|
public inline XMLAttribute(const XMLAttribute & attr) | |
public inline XMLAttribute(const key_type & k) | |
public inline XMLAttribute(const key_type & k,const value_type & v) | |
public inline XMLAttribute(const key_type & k,const char * v) | |
public template<>inline XMLAttribute(const key_type & k,const T & v) | |
public inline key_type & key() | |
public inline const key_type & key() const | |
public inline value_type & value() | |
public inline const value_type & value() const | |
typedef key_type | |
typedef value_type |
Members
public inline XMLAttribute(const XMLAttribute & attr)
public inline XMLAttribute(const key_type & k)
public inline XMLAttribute(const key_type & k,const value_type & v)
public inline XMLAttribute(const key_type & k,const char * v)
public template<>
inline XMLAttribute(const key_type & k,const T & v)
public inline key_type & key()
public inline const key_type & key() const
public inline value_type & value()
public inline const value_type & value() const
typedef key_type
typedef value_type
class alps::XMLAttributes
Summary
| Members | Descriptions |
|---|---|
public inline XMLAttributes() | |
public XMLAttributes(const std::string & str) | |
public inline void clear() | |
public inline size_type size() const | |
public inline bool defined(const key_type & k) const | |
public inline value_type & operator[](const key_type & k) | |
public inline const value_type & operator[](const key_type & k) const | |
public inline value_type value_or_default(const key_type & k,const value_type & v) const | |
public inline iterator begin() | |
public inline const_iterator begin() const | |
public inline iterator end() | |
public inline const_iterator end() const | |
public void push_back(const XMLAttribute & attr) | |
public inline void push_back(const key_type & k,const value_type & v) | |
public inline XMLAttributes&operator<<(const XMLAttribute & a) | |
public inline XMLAttributes&operator<<(const XMLAttributes & attr) | |
typedef key_type | |
typedef value_type | |
typedef list_type | |
typedef size_type | |
typedef iterator | |
typedef const_iterator |
Members
public inline XMLAttributes()
public XMLAttributes(const std::string & str)
public inline void clear()
public inline size_type size() const
public inline bool defined(const key_type & k) const
public inline value_type & operator[](const key_type & k)
public inline const value_type & operator[](const key_type & k) const
public inline value_type value_or_default(const key_type & k,const value_type & v) const
public inline iterator begin()
public inline const_iterator begin() const
public inline iterator end()
public inline const_iterator end() const
public void push_back(const XMLAttribute & attr)
public inline void push_back(const key_type & k,const value_type & v)
public inline XMLAttributes&operator<<(const XMLAttribute & a)
public inline XMLAttributes&operator<<(const XMLAttributes & attr)
typedef key_type
typedef value_type
typedef list_type
typedef size_type
typedef iterator
typedef const_iterator
class alps::XMLHandlerBase
Summary
| Members | Descriptions |
|---|---|
public inline XMLHandlerBase(const std::string & basename) | |
public inline virtual ~XMLHandlerBase() | |
public inline void set_basename(const std::string &) | |
public inline std::string basename() const | |
public void start_element(const std::string & name,const XMLAttributes & attributes,xml::tag_type type) | |
public void end_element(const std::string & name,xml::tag_type type) | |
public void text(const std::string & text) |
Members
public inline XMLHandlerBase(const std::string & basename)
public inline virtual ~XMLHandlerBase()
public inline void set_basename(const std::string &)
public inline std::string basename() const
public void start_element(const std::string & name,const XMLAttributes & attributes,xml::tag_type type)
public void end_element(const std::string & name,xml::tag_type type)
public void text(const std::string & text)
class alps::XMLParser
Summary
| Members | Descriptions |
|---|---|
public XMLParser(XMLHandlerBase &) | |
public ~XMLParser() | |
public void parse(std::istream & is) | |
public void parse(const std::string & file) | |
public void parse(const boost::filesystem::path & file) |
Members
public XMLParser(XMLHandlerBase &)
public ~XMLParser()
public void parse(std::istream & is)
public void parse(const std::string & file)
public void parse(const boost::filesystem::path & file)
struct alps::XMLTag
a struct to store the contents of an XML tag
Summary
| Members | Descriptions |
|---|---|
public std::string name | the name of the tag |
public XMLAttributes attributes | the attributes |
public enum alps::XMLTag type | |
public inline bool is_comment() | returns true if the tag is a comment |
public inline bool is_processing() | returns true if the tag is a processing instruction |
public inline bool is_element() | returns true if the tag is an opening or closing tag of an XML element |
enum `` |
Members
public std::string name
the name of the tag
public XMLAttributes attributes
the attributes
public enum alps::XMLTag type
public inline bool is_comment()
returns true if the tag is a comment
public inline bool is_processing()
returns true if the tag is a processing instruction
public inline bool is_element()
returns true if the tag is an opening or closing tag of an XML element
enum ``
| Values | Descriptions |
|---|---|
| OPENING | |
| CLOSING | |
| SINGLE | |
| COMMENT | |
| PROCESSING |
namespace alps::detail
Summary
| Members | Descriptions |
|---|---|
public std::string parse_string(std::istream & in) | reads a string, enclosed in double quotes " |
public std::string xml_parse_name(std::istream & in) | reads any legal XML tag or atrribute name |
public void xml_read_attribute(std::istream & in,std::string & name,std::string & value) | parses an XML attribute |
public std::string xml_read_tag(std::istream & in) | parses the opening < and the name of a tag |
public void xml_close_tag(std::istream & in) | checks for a closing > of a tag |
public void xml_close_single_tag(std::istream & in) | checks for a closing /> of a tag |
public void skip_comment(std::istream & in,bool processing) | skips over an XML comment or processing instruction |
public inline bool is_identifier_char(char c) | |
struct alps::detail::attribute_t | |
struct alps::detail::end_tag_t | |
struct alps::detail::header_t | |
struct alps::detail::pi_t | |
struct alps::detail::start_tag_t | |
struct alps::detail::stylesheet_t |
Members
public std::string parse_string(std::istream & in)
reads a string, enclosed in double quotes "
public std::string xml_parse_name(std::istream & in)
reads any legal XML tag or atrribute name
public void xml_read_attribute(std::istream & in,std::string & name,std::string & value)
parses an XML attribute
public std::string xml_read_tag(std::istream & in)
parses the opening < and the name of a tag
public void xml_close_tag(std::istream & in)
checks for a closing > of a tag
public void xml_close_single_tag(std::istream & in)
checks for a closing /> of a tag
public void skip_comment(std::istream & in,bool processing)
skips over an XML comment or processing instruction
public inline bool is_identifier_char(char c)
struct alps::detail::attribute_t
Summary
| Members | Descriptions |
|---|---|
public XMLAttribute attr | |
public template<>inline attribute_t(const std::string & n,const T & v) |
Members
public XMLAttribute attr
public template<>
inline attribute_t(const std::string & n,const T & v)
struct alps::detail::end_tag_t
Summary
| Members | Descriptions |
|---|---|
public std::string name | |
public inline end_tag_t(const std::string & n) |
Members
public std::string name
public inline end_tag_t(const std::string & n)
struct alps::detail::header_t
Summary
| Members | Descriptions |
|---|---|
public std::string version | |
public std::string encoding | |
public inline header_t(const std::string & enc) |
Members
public std::string version
public std::string encoding
public inline header_t(const std::string & enc)
struct alps::detail::pi_t
struct alps::detail::pi_t
: public alps::detail::start_tag_tSummary
| Members | Descriptions |
|---|---|
public inline pi_t(const std::string & n) |
Members
public inline pi_t(const std::string & n)
struct alps::detail::start_tag_t
Summary
| Members | Descriptions |
|---|---|
public std::string name | |
public inline start_tag_t(const std::string & n) |
Members
public std::string name
public inline start_tag_t(const std::string & n)
struct alps::detail::stylesheet_t
Summary
| Members | Descriptions |
|---|---|
public std::string url | |
public inline stylesheet_t(const std::string & n) |
Members
public std::string url
public inline stylesheet_t(const std::string & n)
namespace alps::xml
Summary
| Members | Descriptions |
|---|---|
enum tag_type |
Members
enum tag_type
| Values | Descriptions |
|---|---|
| element | |
| processing_instruction | |
| stylesheet |
namespace std
Summary
| Members | Descriptions |
|---|---|
public inline alps::oxstream&endl(alps::oxstream & oxs) |
Members
public inline alps::oxstream&endl(alps::oxstream & oxs)
Generated by Moxygen