VAPOR3 3.9.4
FileOperationChecker.h
Go to the documentation of this file.
1/*
2 * This class provides a set of functions that check if a file/directory
3 * is good to read/write.
4 *
5 * The rational is recorded in this post:
6 * https://github.com/NCAR/VAPOR/wiki/Robust-File-Operations-with-VAPOR-and-Qt
7 *
8 */
9
10#ifndef FILEOPERATIONCHECKER_H
11#define FILEOPERATIONCHECKER_H
12
13#include <QString>
14
16public:
17 static bool DirectoryGoodToRead(const QString &filename);
18 static bool FileGoodToRead(const QString &filename);
19 static bool FileGoodToWrite(const QString &filename);
20 static bool FileHasCorrectSuffix(const QString &filename, const QString &expectedSuffix);
21 static QString GetLastErrorMessage();
22
23private:
24 static QString _message;
25};
26
27#endif
static bool DirectoryGoodToRead(const QString &filename)
static bool FileGoodToRead(const QString &filename)
static bool FileGoodToWrite(const QString &filename)
static QString GetLastErrorMessage()
static bool FileHasCorrectSuffix(const QString &filename, const QString &expectedSuffix)