Simpatico  v1.10
XmlStartTag.h
1 #ifndef UTIL_XML_START_TAG_H
2 #define UTIL_XML_START_TAG_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 "XmlAttribute.h"
13 #include <sstream>
14 #include <vector>
15 
16 namespace Util
17 {
18 
36  class XmlStartTag : public XmlBase
37  {
38 
39  public:
40 
44  XmlStartTag();
45 
49  ~XmlStartTag();
50 
58  bool matchLabel(const std::string& string, int begin);
59 
69  void matchLabel(const std::string expected,
70  const std::string& string, int begin);
71 
78  bool matchAttribute(XmlAttribute& attribute);
79 
85  void finish();
86 
90  const std::string label()
91  { return label_; }
92 
96  bool endBracket()
97  { return endBracket_; }
98 
99  private:
100 
104  std::string label_;
105 
109  bool endBracket_;
110 
111  };
112 
113 }
114 #endif
bool matchLabel(const std::string &string, int begin)
Match opening bracket and any label.
Definition: XmlStartTag.cpp:21
bool matchAttribute(XmlAttribute &attribute)
Attempt to match an attribute.
Definition: XmlStartTag.cpp:71
Parser for an XML start tag.
Definition: XmlStartTag.h:36
Base class for classes that parse XML markup tags.
Definition: XmlBase.h:22
XmlStartTag()
Constructor.
Definition: XmlStartTag.cpp:14
Parser for an XML attribute.
Definition: XmlAttribute.h:23
Utility classes for scientific computation.
Definition: accumulators.mod:1
const std::string label()
Label string.
Definition: XmlStartTag.h:90
bool endBracket()
True if a closing bracket was found.
Definition: XmlStartTag.h:96
~XmlStartTag()
Destructor.
Definition: XmlStartTag.cpp:18
void finish()
Check if end bracket was found.
Definition: XmlStartTag.cpp:93