Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Teuchos_XMLParser.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Teuchos: Common Tools Package
4 //
5 // Copyright 2004 NTESS and the Teuchos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef TEUCHOS_XMLPARSER_H
11 #define TEUCHOS_XMLPARSER_H
12 
18 #include "Teuchos_ConfigDefs.hpp"
19 #include "Teuchos_XMLObject.hpp"
21 
22 namespace Teuchos
23 {
39  {
40  public:
41 
43  XMLParser(RCP<XMLInputStream> is) : _is(is), _lineNo(1) {;}
44 
47 
49  XMLObject parse();
50  private:
51 //use pragmas to disable some false-positive warnings for windows sharedlibs export
52 #ifdef _MSC_VER
53 #pragma warning(push)
54 #pragma warning(disable:4251)
55 #endif
58  long _lineNo;
59 #ifdef _MSC_VER
60 #pragma warning(pop)
61 #endif
62 
64  inline static bool isLetter(unsigned char c);
66  inline static bool isNameChar(unsigned char c);
68  inline static bool isChar(unsigned char c);
70  inline static bool isSpace(unsigned char c);
71 
78  void getETag(std::string &tag);
79 
96  void getSTag(unsigned char lookahead, std::string &tag, Teuchos::map<std::string,string> &attrs, bool &emptytag);
97 
101  void getComment(long startLine);
102 
110  int getSpace(unsigned char &lookahead);
111 
118  void getReference(std::string &refstr);
119 
122  void ignoreXMLDeclaration();
123 
132  int assertChar(unsigned char cexp);
133  };
134 }
135 
136 #endif
XMLParser(RCP< XMLInputStream > is)
Constructor.
Teuchos header file which uses auto-configuration information to include necessary C++ headers...
RCP< XMLInputStream > _is
A base class for defining a XML input stream.
XMLParser consumes characters from an XMLInputStream object, parsing the XML and using a TreeBuilding...
Representation of an XML data tree. XMLObject is a ref-counted handle to a XMLObjectImplem object...
Teuchos::map< std::string, string > _entities
~XMLParser()
Destructor.
#define TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT
Smart reference counting pointer class for automatic garbage collection.
An object representation of a subset of XML data.