| 69 | } |
| 70 | |
| 71 | bool MakeDir(const QString& path, bool isDir) { |
| 72 | QString dirPath; |
| 73 | QFileInfo fileInfo(path); |
| 74 | if (isDir) { |
| 75 | dirPath = path; |
| 76 | } else { |
| 77 | dirPath = fileInfo.absolutePath(); |
| 78 | } |
| 79 | QDir dir(dirPath); |
| 80 | if (dir.exists()) { |
| 81 | return true; |
| 82 | } |
| 83 | return dir.mkpath(dirPath); |
| 84 | } |
| 85 | |
| 86 | bool WriteFileToDisk(const std::shared_ptr<File>& file, const QString& filePath) { |
| 87 | auto encodeByteData = pag::Codec::Encode(file); |