Utils/VrUtils/Inc/VrFileUtils.h
杰仔 9bcdc61c5a 初始提交:Utils 工具库模块
包含以下子模块:
- VrCommon: 核心接口和数据结构
- VrUtils: 工具类库(JSON、log4cpp、tinyxml2、INI、MD5、CRC)
- CloudUtils: 点云工具
- DataUtils: 数据处理工具(CloudMathClac、CoordinateTransform)
- CloudView: 点云查看工具

功能说明:
- 提供项目通用的基础工具类和实用功能
- 支持 Windows (MSVC/MinGW) 和 Linux (ARM/x86_64) 平台
- 使用 Qt qmake 构建系统
- 所有模块编译为静态库
2026-02-18 16:00:16 +08:00

45 lines
1.2 KiB
C++

#pragma once
#include <iostream>
#include <vector>
namespace CVrFileUtils
{
/// 文件是否存在
bool IsFileExist(const char* pFileName);
/// 文件大小
size_t GetFileSize(const char* fileName);
/// 写文件
bool WriteFileData(const char* pFileName, const char* pData, const size_t nLen, bool isAppend = false);
/// 读文件
bool ReadFileData(const char* pFileName, char* pData, size_t* pLen, const int nOffset = 0);
/// 获取目录下所有的文件
bool GetFileList(std::string& pDirPath, std::string exd, std::vector<std::string>& vetFiles);
/// 获取目录下所有目录
bool GetDirList(std::string& pDirPath, std::vector<std::string>& vetFiles);
/// 文件重命名
bool ReNameFile(const char* oldName, const char* newName);
/// 删除文件
bool DeleteLocalFile(const char* sFileName);
/*******目录操作*******/
/// 目录是否存在
bool IsDirExist(const char* szDirectory);
/// 创建新的文件夹
bool CreatNewDir(const char* szPath);
/// 删除目录
bool DeleteDir(const char* szDirPath);
/// 去除后缀获取文件名称
std::string GetFileName(const std::string& filePath, bool bHasSuffix = true);
} // namespace name