#pragma once #ifndef FILEOPERATOR_H #define FILEOPERATOR_H #include "BaseConstVariable.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include bool BASECONSTVARIABLEAPI isDirectory(const QString& path); bool BASECONSTVARIABLEAPI isExists(const QString& path); bool BASECONSTVARIABLEAPI isFile(const QString& path); void BASECONSTVARIABLEAPI removeFile(const QString& filePath); unsigned long BASECONSTVARIABLEAPI convertToULong(const QString& input); /// /// 获取文件(绝对路径) /// /// /// /// std::vector BASECONSTVARIABLEAPI getFilelist(const QString& folderpath, const QString& FilenameExtension = ".*", int (*logfun)(QString logtext, int value) = nullptr); QString BASECONSTVARIABLEAPI getParantFolderNameFromPath(const QString& path); QString BASECONSTVARIABLEAPI getFileNameFromPath(const QString& path); QString BASECONSTVARIABLEAPI getFileNameWidthoutExtend(QString path); QString BASECONSTVARIABLEAPI getFileExtension(QString path); int BASECONSTVARIABLEAPI write_binfile(char* filepath, char* data, size_t data_len); char* read_textfile(char* text_path, int* length); bool BASECONSTVARIABLEAPI exists_test(const QString& name); size_t BASECONSTVARIABLEAPI fsize(FILE* fp); QString BASECONSTVARIABLEAPI getParantFromPath(const QString& path); void BASECONSTVARIABLEAPI copyFile(const QString& sourcePath, const QString& destinationPath); QString BASECONSTVARIABLEAPI addMaskToFileName(const QString& filePath, QString _zzname); // QT FileOperator bool BASECONSTVARIABLEAPI copyAndReplaceFile(const QString& sourceFilePath, const QString& destinationFilePath); // 压缩包文件解压 bool BASECONSTVARIABLEAPI unTarfile(QString inTargzPath,QString outGzFolderPath); bool BASECONSTVARIABLEAPI createNewFolerPath(QString inpath, bool isremoveExist = false); QFileInfoList BASECONSTVARIABLEAPI findFilePath(const QString& dirPath, const QString& pattern); #endif