• 大小: 11KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-01-02
  • 标签: 网上收集  c++  

资源简介

很好的文件操作工具类 好东西要分享

资源截图

代码片段和文件信息

#include “StdAfx.h“
#include “FileUtil.h“
#include 
#include 
#include 
#include 
#include  
#include     
#include 
#include 
using namespace std; 

#pragma warning(disable:4996)
#ifdef _DEBUG 
#define new DEBUG_NEW
#endif

FileUtil::FileUtil(void)
{
}


FileUtil::~FileUtil(void)
{
}

/*
 * 创建路径(仅单级路径) 
 * 参数一:路径
 * 返回:true创建成功(路径存在)/false创建失败
 */
BOOL FileUtil::createDir(CString path){
ifstream file;
file.open(path);
if (!file.is_open()) {//校验本地路径是否存在
   //目录不存在
//本地创建路径
if(CreateDirectory(path NULL)){
return true;
}else{
return false;
}
}
return false;
}

/*
 * 校验路径是否存在 
 * 参数一:路径
 * 返回:true存在/false不存在
 */
BOOL FileUtil::checkDir(CString pat

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件           0  2018-10-30 10:21  C++鏂囦欢鎿嶄綔宸ュ叿绫?
     文件        7916  2017-09-20 11:26  C++鏂囦欢鎿嶄綔宸ュ叿绫?FileUtil.h
     目录           0  2018-10-30 10:45  __MACOSX\
     文件           0  2018-10-30 10:45  __MACOSX\C++鏂囦欢鎿嶄綔宸ュ叿绫?
     文件         232  2017-09-20 11:26  __MACOSX\C++鏂囦欢鎿嶄綔宸ュ叿绫?._FileUtil.h
     文件       23072  2017-09-20 11:16  C++鏂囦欢鎿嶄綔宸ュ叿绫?FileUtil.cpp
     文件         176  2017-09-20 11:16  __MACOSX\C++鏂囦欢鎿嶄綔宸ュ叿绫?._FileUtil.cpp
     文件         176  2018-10-30 10:21  __MACOSX\._C++鏂囦欢鎿嶄綔宸ュ叿绫?

评论

共有 条评论