#include <iostream>
using std::ifstream;
-
+using std::istream;
+using std::string;
\f
////////////////////////////////////////////////////////////////////////
void XMLVisitor::savePosition(void)
{
- column = XML_GetCurrentColumnNumber(parser);
- line = XML_GetCurrentLineNumber(parser);
+ if (parser) {
+ column = XML_GetCurrentColumnNumber(parser);
+ line = XML_GetCurrentLineNumber(parser);
+ }
}
////////////////////////////////////////////////////////////////////////
#include <string>
#include <vector>
-using std::istream;
-using std::string;
-using std::vector;
-
typedef struct XML_ParserStruct* XML_Parser;
/**
virtual void setValue (const char * name, const char * value);
private:
- vector<string> _atts;
+ std::vector<std::string> _atts;
};
////////////////////////////////////////////////////////////////////////
* @param _path The path to the parsed file.
* @see #getPath
*/
- void setPath(const string& _path) { path = _path; }
+ void setPath(const std::string& _path) { path = _path; }
/** Get the path to the parsed file.
*
* @return the path to the parsed file.
* @see #setPath
*/
- const string& getPath(void) const { return path; }
+ const std::string& getPath(void) const { return path; }
/** Save the current position in the parsed file.
*
void setParser(XML_Parser _parser) { parser = _parser; }
private:
XML_Parser parser;
- string path;
+ std::string path;
int line, column;
};
* is a problem reading the file.
* @see XMLVisitor
*/
-extern void readXML (istream &input, XMLVisitor &visitor,
- const string &path="");
+extern void readXML (std::istream &input, XMLVisitor &visitor,
+ const std::string &path="");
/**
* is a problem reading the file.
* @see XMLVisitor
*/
-extern void readXML (const string &path, XMLVisitor &visitor);
+extern void readXML (const std::string &path, XMLVisitor &visitor);
/**