Date started: 02/04/07
Purpose: Shared base class that wraps the XML file reading logic
- ------------- Copyright (C) 2007 Jon S. Berndt (jsb@hal-pc.org) -------------
+ ------------- Copyright (C) 2007 Jon S. Berndt (jon@jsbsim.org) -------------
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free Software
INCLUDES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#include <input_output/FGXMLParse.h>
+#include "input_output/FGXMLParse.h"
+#include <iostream>
+#include <fstream>
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DEFINITIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#define ID_XMLFILEREAD "$Id$"
+#define ID_XMLFILEREAD "$Id: FGXMLFileRead.h,v 1.5 2009/11/28 20:12:47 andgi Exp $"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
protected:
Element* document;
- Element* LoadXMLDocument(string XML_filename)
+ Element* LoadXMLDocument(std::string XML_filename)
{
- ifstream infile;
+ std::ifstream infile;
if ( !XML_filename.empty() ) {
- if (XML_filename.find(".xml") == string::npos) XML_filename += ".xml";
+ if (XML_filename.find(".xml") == std::string::npos) XML_filename += ".xml";
infile.open(XML_filename.c_str());
if ( !infile.is_open()) {
- cerr << "Could not open file: " << XML_filename << endl;
+ std::cerr << "Could not open file: " << XML_filename << std::endl;
return 0L;
}
} else {
- cerr << "No filename given." << endl;
+ std::cerr << "No filename given." << std::endl;
return 0L;
}
- readXML(infile, file_parser);
+ readXML(infile, file_parser, XML_filename);
document = file_parser.GetDocument();
infile.close();