#pragma once #include #include #include #include #include #include #include #include #include #include #include class fileManager { public: /// /// 获取所有文件夹 /// /// /// static std::vector getAllDirs(const QString& folderPath); /// /// 获取文件夹下格式的文件,以vector返回 /// /// /// /// static void getAllFiles(std::string path, std::vector& files, std::string format, int targetDepth = INT_MAX, int depth = 0); /// /// 获取文件夹下的图片,以vector返回 /// /// /// /// static void getAllImages(std::string path, std::vector& files, std::string format, int targetDepth = INT_MAX, int depth = 0); /// /// 检查磁盘剩余空间,以GB为单位返回 /// /// example"E://""E://111/222"支持文件夹或者磁盘路径 /// static int getDriveFreeSpaceAsGb(const QString& folderPath); /// /// 检查磁盘剩余空间,以Mb为单位返回 /// /// example"E://""E://111/222"支持文件夹或者磁盘路径 /// static int getDriveFreeSpaceAsMb(const QString& folderPath); //去除重复分割符 static QString normalizePathSeparators(const QString& path); static bool isImageFile(const std::string& filename); static std::string getFileName(std::string path); static QString getFileName(const QString& path); //统一地址分隔符 static QString normalizePathStr(const QString& address, QChar targetSeparator = '/'); //统一地址分隔符 static std::string normalizePathStr(const std::string& address, char targetSeparator = '/'); static void createDirectoryIfNotExists(const std::string& path); static EUI_TOOLS_API bool setFileReadOnly(const std::string& filePath, bool readOnly); };