| 16 | } |
| 17 | |
| 18 | bool readFile(const QString& path, QString& data, Logger* log, bool ignError) |
| 19 | { |
| 20 | QFile file(path); |
| 21 | if (!fileExists(path, log, ignError)) |
| 22 | { |
| 23 | return false; |
| 24 | } |
| 25 | |
| 26 | if (!file.open(QFile::ReadOnly | QFile::Text)) |
| 27 | { |
| 28 | if (!ignError) |
| 29 | resolveFileError(file, log); |
| 30 | return false; |
| 31 | } |
| 32 | |
| 33 | QTextStream in(&file); |
| 34 | |
| 35 | data = in.readAll(); |
| 36 | |
| 37 | file.close(); |
| 38 | |
| 39 | return true; |
| 40 | } |
| 41 | |
| 42 | bool fileExists(const QString& path, Logger* log, bool ignError) |
| 43 | { |
no test coverage detected