36 lines
1.1 KiB
C++
36 lines
1.1 KiB
C++
/**
|
|
* \brief UnixFileManager declarations
|
|
* \author Nan Zhou, nanzhou at kneron dot us
|
|
* \copyright 2019 Kneron Inc. All right reserved.
|
|
*/
|
|
|
|
#ifndef PIANO_DYNASTY_INCLUDE_IO_UNIXFILEMANAGER_H_
|
|
#define PIANO_DYNASTY_INCLUDE_IO_UNIXFILEMANAGER_H_
|
|
|
|
#include <vector>
|
|
#include <string>
|
|
|
|
namespace dynasty {
|
|
namespace io {
|
|
class UnixFileManager {
|
|
public:
|
|
static bool IsRegularFile(std::string const &path_to_judge);
|
|
static bool IsDirectory(std::string const &path_to_judge);
|
|
static int DirExist(std::string const &path_to_judge);
|
|
static int CreateDirectory(std::string const &path_to_judge);
|
|
static std::vector<std::string> GetFilesInDirectory(std::string const &path_to_search);
|
|
static std::string PathJoin(std::string const &path1, std::string const &path2);
|
|
UnixFileManager() = default;
|
|
~UnixFileManager() = default;
|
|
|
|
private:
|
|
static void dfs(std::string const &path_to_search, std::vector<std::string> &files_path_vector);
|
|
|
|
private:
|
|
static char const PATH_DELIMITER = '/';
|
|
};
|
|
}
|
|
}
|
|
|
|
#endif //PIANO_DYNASTY_INCLUDE_IO_UNIXFILEMANAGER_H_
|