summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorM4xw <m4x@m4xw.net>2022-03-22 16:45:03 +0100
committerM4xw <m4x@m4xw.net>2022-03-22 16:45:03 +0100
commit6426f97988acd5184d0cec557e972bf5b2e56d00 (patch)
tree04884ea1c1e65cab8cdccbc83cecd8a085902ab5
parent4135e3c936edafbec653669693183b4d6b460c4b (diff)
[ZAPDTR] Minor changes for CreateDirectory
-rw-r--r--ZAPDTR/ZAPDUtils/Utils/Directory.h24
1 files changed, 6 insertions, 18 deletions
diff --git a/ZAPDTR/ZAPDUtils/Utils/Directory.h b/ZAPDTR/ZAPDUtils/Utils/Directory.h
index d14ec264e..b1ce49699 100644
--- a/ZAPDTR/ZAPDUtils/Utils/Directory.h
+++ b/ZAPDTR/ZAPDUtils/Utils/Directory.h
@@ -34,32 +34,20 @@ public:
static void CreateDirectory(const std::string& path)
{
-
-#ifdef _MSC_VER
- std::string splitChar = "\\";
-#else
- std::string splitChar = "/";
-#endif
-
- std::string curPath;
- std::vector<std::string> split = StringHelper::Split(path, splitChar);
-
- for (std::string s : split)
+ try
+ {
+ fs::create_directories(path);
+ }
+ catch (...)
{
- curPath += s + splitChar;
-
- if (!Exists(curPath))
- fs::create_directory(curPath);
}
-
- // fs::create_directory(path);
}
static std::vector<std::string> ListFiles(const std::string& dir)
{
std::vector<std::string> lst;
- if (Directory::Exists(dir))
+ if (Exists(dir))
{
for (auto& p : fs::recursive_directory_iterator(dir))
{