mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-21 23:58:51 -05:00
[ZAPDTR] Minor changes for CreateDirectory
This commit is contained in:
parent
4135e3c936
commit
6426f97988
@ -34,32 +34,20 @@ public:
|
|||||||
|
|
||||||
static void CreateDirectory(const std::string& path)
|
static void CreateDirectory(const std::string& path)
|
||||||
{
|
{
|
||||||
|
try
|
||||||
#ifdef _MSC_VER
|
{
|
||||||
std::string splitChar = "\\";
|
fs::create_directories(path);
|
||||||
#else
|
}
|
||||||
std::string splitChar = "/";
|
catch (...)
|
||||||
#endif
|
|
||||||
|
|
||||||
std::string curPath;
|
|
||||||
std::vector<std::string> split = StringHelper::Split(path, splitChar);
|
|
||||||
|
|
||||||
for (std::string s : split)
|
|
||||||
{
|
{
|
||||||
curPath += s + splitChar;
|
|
||||||
|
|
||||||
if (!Exists(curPath))
|
|
||||||
fs::create_directory(curPath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// fs::create_directory(path);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::vector<std::string> ListFiles(const std::string& dir)
|
static std::vector<std::string> ListFiles(const std::string& dir)
|
||||||
{
|
{
|
||||||
std::vector<std::string> lst;
|
std::vector<std::string> lst;
|
||||||
|
|
||||||
if (Directory::Exists(dir))
|
if (Exists(dir))
|
||||||
{
|
{
|
||||||
for (auto& p : fs::recursive_directory_iterator(dir))
|
for (auto& p : fs::recursive_directory_iterator(dir))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user