File.hpp
1 //
2 // Created by xiong on 2022/6/9.
3 //
4 
5 #ifndef EMX_File_HPP
6 #define EMX_File_HPP
7 
8 #include "core/EmxTypeDef.hpp"
9 
10 namespace Emx {
16  class File {
17  public:
19  static bool IsDir(const char *path);
20 
22  static bool IsFile(const char *path);
23 
25  static ErrCodeE Copy(const char *src, const char *dst);
26 
28  static bool Exist(const char *path);
29 
31  static void Create(const char *path);
32 
34  static int32_t Size(const char *path);
35 
37  static void Remove(const char *path);
38 
40  static ErrCodeE Read(const char *path, std::string &buffer);
41 
43  static ErrCodeE Write(const char *path, const char *buffer, int size);
44  };
45 
47 }
48 
49 #endif //EMX_File_HPP
文件操作相关函数
Definition: File.hpp:16
static bool IsFile(const char *path)
路径是否为文件
static void Create(const char *path)
创建一个文件
static ErrCodeE Read(const char *path, std::string &buffer)
从文件中读取数据
static bool Exist(const char *path)
文件是否存在
static ErrCodeE Copy(const char *src, const char *dst)
文件拷贝
static bool IsDir(const char *path)
路径是否为文件夹
static void Remove(const char *path)
删除一个文件
static int32_t Size(const char *path)
文件大小
static ErrCodeE Write(const char *path, const char *buffer, int size)
向文件中写入数据
ErrCodeE
错误码定义
Definition: EmxTypeDef.hpp:29
Definition: EmxGpio.hpp:10