diff --git a/Applications/FileIO/XmlIO/Qt/XmlPrjInterface.cpp b/Applications/FileIO/XmlIO/Qt/XmlPrjInterface.cpp index 1265069a32d8c276a549aed3a4a4e34da919889d..88b82638c4327d666d9a48c520f6672c08bb4bbc 100644 --- a/Applications/FileIO/XmlIO/Qt/XmlPrjInterface.cpp +++ b/Applications/FileIO/XmlIO/Qt/XmlPrjInterface.cpp @@ -54,7 +54,7 @@ int XmlPrjInterface::readFile(const QString& fileName) QDomNode param_root = QDomNode(); QDomNode pvar_root = QDomNode(); QDomDocument doc("OGS-PROJECT-DOM"); - doc.setContent(_fileData); + doc.setContent(getContent()); QDomElement docElement = doc.documentElement(); // OpenGeoSysProject if (docElement.nodeName().compare("OpenGeoSysProject")) { diff --git a/BaseLib/IO/XmlIO/Qt/XMLQtInterface.cpp b/BaseLib/IO/XmlIO/Qt/XMLQtInterface.cpp index 7ba8d894b8c5f1ec9da11836e83e2db5300fb4e2..f413563fc093c524e0ed4b26a9fda2f9c74287b6 100644 --- a/BaseLib/IO/XmlIO/Qt/XMLQtInterface.cpp +++ b/BaseLib/IO/XmlIO/Qt/XMLQtInterface.cpp @@ -129,5 +129,10 @@ bool XMLQtInterface::checkHash() const } return true; } + +QByteArray const& XMLQtInterface::getContent() const +{ + return _fileData; +} } // namespace IO } // namespace BaseLib diff --git a/BaseLib/IO/XmlIO/Qt/XMLQtInterface.h b/BaseLib/IO/XmlIO/Qt/XMLQtInterface.h index bc705948405e0cd445edb144cea11522596fae3e..a6363a7bcea086c4b03349a2203c6814e11e1689 100644 --- a/BaseLib/IO/XmlIO/Qt/XMLQtInterface.h +++ b/BaseLib/IO/XmlIO/Qt/XMLQtInterface.h @@ -41,8 +41,9 @@ protected: /// If no hash file exists, the xml-file is validated and a hash file is written if the xml-file was valid. bool checkHash() const; - /// Caches the actual file contents when reading. - QByteArray _fileData; + /// Read access to the content of the read file. Must be used after readFile + /// has been called. + QByteArray const& getContent() const; private: /// Check if the given xml-file is valid considering the schema-file used in @@ -52,7 +53,11 @@ private: private: /// The actual file name when reading. QString _fileName; + QString _schemaFile; + + /// Caches the actual file contents when reading. + QByteArray _fileData; }; } // end namespace IO diff --git a/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp b/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp index 292582cc8a3fbe6464e620a72479924f9142fad1..b0274052f6dc94895e05e44c8a01f6dc45ec94f5 100644 --- a/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp +++ b/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp @@ -71,7 +71,7 @@ int XmlGmlInterface::readFile(const QString &fileName) } QDomDocument doc("OGS-GLI-DOM"); - doc.setContent(_fileData); + doc.setContent(getContent()); QDomElement docElement = doc.documentElement(); //OpenGeoSysGLI if (docElement.nodeName().compare("OpenGeoSysGLI")) { diff --git a/GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp b/GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp index 1b8283806f6dbfd6dd72a25bc2beb50f3348f062..59e15aa4e112582d3e2d29478f9803149f9680b5 100644 --- a/GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp +++ b/GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp @@ -44,7 +44,7 @@ int XmlStnInterface::readFile(const QString &fileName) } QDomDocument doc("OGS-STN-DOM"); - doc.setContent(_fileData); + doc.setContent(getContent()); QDomElement docElement = doc.documentElement(); //root element, used for identifying file-type if (docElement.nodeName().compare("OpenGeoSysSTN")) {