nndeploy C++ API  0.2.0
nndeploy C++ API
file.h
Go to the documentation of this file.
1 
2 #ifndef _NNDEPLOY_BASE_FILE_H_
3 #define _NNDEPLOY_BASE_FILE_H_
4 
6 #include "nndeploy/base/macro.h"
7 #include "nndeploy/base/status.h"
8 
9 namespace nndeploy {
10 namespace base {
11 
12 #ifdef _MSC_VER
13 #define NNDEPLOY_PATH_SEP "\\"
14 #else
15 #define NNDEPLOY_PATH_SEP "/"
16 #endif
17 
18 extern NNDEPLOY_CC_API std::string openFile(const std::string &file_path);
19 
20 extern NNDEPLOY_CC_API bool isPathSeparator(char c);
21 
22 extern NNDEPLOY_CC_API bool exists(const std::string &path);
23 extern NNDEPLOY_CC_API bool isDirectory(const std::string &path);
24 
25 extern NNDEPLOY_CC_API void removeAllFile(const std::string &path);
26 
27 extern NNDEPLOY_CC_API std::string getcwd();
28 
35 extern NNDEPLOY_CC_API std::string canonicalPath(const std::string &path);
36 
38 extern NNDEPLOY_CC_API std::string joinPath(const std::string &base,
39  const std::string &path);
40 
42 extern NNDEPLOY_CC_API std::string getParentPath(const std::string &path);
43 extern NNDEPLOY_CC_API std::wstring getParentPath(const std::wstring &path);
44 
57 extern NNDEPLOY_CC_API void glob(const std::string &directory,
58  const std::string &pattern,
59  std::vector<std::string> &result,
60  bool recursive = false,
61  bool include_directories = false);
62 
73 extern NNDEPLOY_CC_API void globRelative(const std::string &directory,
74  const std::string &pattern,
75  std::vector<std::string> &result,
76  bool recursive = false,
77  bool include_directories = false);
78 
79 extern NNDEPLOY_CC_API bool createDirectory(const std::string &path);
80 extern NNDEPLOY_CC_API bool createDirectories(const std::string &path_param);
81 
82 } // namespace base
83 } // namespace nndeploy
84 
85 #endif
#define NNDEPLOY_CC_API
api
Definition: macro.h:29
bool createDirectories(const std::string &path_param)
bool isDirectory(const std::string &path)
std::string openFile(const std::string &file_path)
bool isPathSeparator(char c)
bool createDirectory(const std::string &path)
std::string getParentPath(const std::string &path)
std::string canonicalPath(const std::string &path)
Converts path p to a canonical absolute path Symlinks are processed if there is support for them on r...
void globRelative(const std::string &directory, const std::string &pattern, std::vector< std::string > &result, bool recursive=false, bool include_directories=false)
void removeAllFile(const std::string &path)
std::string getcwd()
std::string joinPath(const std::string &base, const std::string &path)
bool exists(const std::string &path)
void glob(const std::string &directory, const std::string &pattern, std::vector< std::string > &result, bool recursive=false, bool include_directories=false)