| 1 |
/*========================================================================= |
| 2 |
|
| 3 |
Program: KWStyle - Kitware Style Checker |
| 4 |
Module: kwsXMLReader.h |
| 5 |
|
| 6 |
Copyright (c) Kitware, Inc. All rights reserved. |
| 7 |
See Copyright.txt or http://www.kitware.com/Copyright.htm for details. |
| 8 |
|
| 9 |
This software is distributed WITHOUT ANY WARRANTY; without even |
| 10 |
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 11 |
PURPOSE. See the above copyright notices for more information. |
| 12 |
|
| 13 |
=========================================================================*/ |
| 14 |
#ifndef kwsXMLReader_h |
| 15 |
#define kwsXMLReader_h |
| 16 |
|
| 17 |
#include <iostream> |
| 18 |
#include <stdlib.h> |
| 19 |
#include <stdio.h> |
| 20 |
#include <fstream> |
| 21 |
#include <string> |
| 22 |
|
| 23 |
namespace kws{ |
| 24 |
|
| 25 |
class XMLReader |
| 26 |
{ |
| 27 |
|
| 28 |
public: |
| 29 |
|
| 30 |
XMLReader(); |
| 31 |
~XMLReader(); |
| 32 |
bool Open(const char* filename); |
| 33 |
std::string GetTag(); |
| 34 |
std::string GetCurrentTag(); |
| 35 |
std::string GetValue(); |
| 36 |
void Close(); |
| 37 |
|
| 38 |
/** Check the file to see if a current tag is defined */ |
| 39 |
std::string GetValue(std::string tag); |
| 40 |
|
| 41 |
private: |
| 42 |
|
| 43 |
std::ifstream m_File; |
| 44 |
std::string m_Value; |
| 45 |
std::string m_Tag; |
| 46 |
std::string m_Buffer; |
| 47 |
size_t m_CurrentPos; |
| 48 |
|
| 49 |
}; |
| 50 |
|
| 51 |
} // end namespace |
| 52 |
|
| 53 |
#endif |