64 lines
2.2 KiB
C++
64 lines
2.2 KiB
C++
#pragma once
|
|
|
|
#ifndef FILEOPERATOR_H
|
|
#define FILEOPERATOR_H
|
|
#include "BaseConstVariable.h"
|
|
#include <string.h>
|
|
#include <memory.h>
|
|
#include <memory>
|
|
#include <io.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <string>
|
|
#include <vector>
|
|
#include <QString>
|
|
#include <QDir>
|
|
#include <QFile>
|
|
#include <QDebug>
|
|
#include <QFileInfoList>
|
|
|
|
|
|
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);
|
|
/// <summary>
|
|
/// 获取文件(绝对路径)
|
|
/// </summary>
|
|
/// <param name="folderpath"></param>
|
|
/// <param name="FilenameExtension"></param>
|
|
/// <returns></returns>
|
|
std::vector<QString> 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 |