OGS
|
Definition at line 28 of file XMLQtInterface.h.
#include <XMLQtInterface.h>
Public Member Functions | |
XMLQtInterface (QString schemaFile="") | |
virtual | ~XMLQtInterface ()=default |
virtual int | readFile (const QString &fileName) |
Protected Member Functions | |
bool | checkHash () const |
QByteArray const & | getContent () const |
Private Member Functions | |
int | isValid () const |
Private Attributes | |
QString | fileName_ |
The actual file name when reading. | |
QString | schemaFile_ |
QByteArray | fileData_ |
Caches the actual file contents when reading. | |
|
explicit |
Definition at line 32 of file XMLQtInterface.cpp.
|
virtualdefault |
|
protected |
Checks if a hash for the given data file exists to skip the time-consuming validation part. If a hash file exists and the hash of the data file is the same as the content of the hash file the validation is skipped If no hash file exists, the xml-file is validated and a hash file is written if the xml-file was valid.
Definition at line 99 of file XMLQtInterface.cpp.
References fileData_, fileName_, INFO(), isValid(), and WARN().
Referenced by readFile().
|
protected |
Read access to the content of the read file. Must be used after readFile has been called.
Definition at line 136 of file XMLQtInterface.cpp.
References fileData_.
Referenced by FileIO::XmlPrjInterface::readFile(), GeoLib::IO::XmlGmlInterface::readFile(), and GeoLib::IO::XmlStnInterface::readFile().
|
private |
Check if the given xml-file is valid considering the schema-file used in the constructor
Definition at line 58 of file XMLQtInterface.cpp.
References fileData_, fileName_, INFO(), and schemaFile_.
Referenced by checkHash().
|
virtual |
Reads the file. In an overridden function in the child class be sure to call XMLQtInterface::readFile(fileName).
Reimplemented in FileIO::XmlPrjInterface, GeoLib::IO::XmlGmlInterface, and GeoLib::IO::XmlStnInterface.
Definition at line 37 of file XMLQtInterface.cpp.
References checkHash(), ERR(), fileData_, and fileName_.
|
private |
Caches the actual file contents when reading.
Definition at line 60 of file XMLQtInterface.h.
Referenced by checkHash(), getContent(), isValid(), and readFile().
|
private |
The actual file name when reading.
Definition at line 55 of file XMLQtInterface.h.
Referenced by checkHash(), isValid(), and readFile().
|
private |
Definition at line 57 of file XMLQtInterface.h.
Referenced by isValid().