Simpatico  v1.10
XmlAttribute.h
1 #ifndef UTIL_XML_ATTRIBUTE_H
2 #define UTIL_XML_ATTRIBUTE_H
3 
4 /*
5 * Util Package - C++ Utilities for Scientific Computation
6 *
7 * Copyright 2010 - 2017, The Regents of the University of Minnesota
8 * Distributed under the terms of the GNU General Public License.
9 */
10 
11 #include "XmlBase.h"
12 #include <sstream>
13 #include <vector>
14 
15 namespace Util
16 {
17 
23  class XmlAttribute : public XmlBase
24  {
25 
26  public:
27 
31  XmlAttribute();
32 
36  virtual ~XmlAttribute();
37 
41  bool match(const std::string& string, int begin);
42 
48  bool match(XmlBase& parser);
49 
53  const std::string& label()
54  { return label_; }
55 
59  std::stringstream& value()
60  { return value_; }
61 
62  private:
63 
64  std::string label_;
65  std::stringstream value_;
66 
67  };
68 
69 }
70 #endif
Base class for classes that parse XML markup tags.
Definition: XmlBase.h:22
XmlAttribute()
Constructor.
std::stringstream & value()
Return value string, without quotes.
Definition: XmlAttribute.h:59
Parser for an XML attribute.
Definition: XmlAttribute.h:23
const std::string & label()
Return label string.
Definition: XmlAttribute.h:53
Utility classes for scientific computation.
Definition: accumulators.mod:1
virtual ~XmlAttribute()
Destructor.
bool match(const std::string &string, int begin)
Return true if an attribute is found, false otherwise.