utility: creating directories with boost in FileSystem method

This commit is contained in:
Eberhard Graether
2015-12-02 15:23:27 +01:00
parent 7d0b3773e7
commit 35b5e423da
3 changed files with 9 additions and 2 deletions
+5
View File
@@ -159,6 +159,11 @@ bool FileSystem::equivalent(const std::string& pathA, const std::string& pathB)
return boost::filesystem::path(pathA).compare(boost::filesystem::path(pathB)) == 0;
}
void FileSystem::createDirectory(const FilePath& path)
{
boost::filesystem::create_directory(path.str());
}
std::vector<FilePath> FileSystem::getSubDirectories(const FilePath &path)
{
std::vector<FilePath> v;
+1
View File
@@ -23,6 +23,7 @@ public:
static TimePoint getLastWriteTime(const FilePath& filePath);
static std::string getTimeStringNow();
static void createDirectory(const FilePath& path);
static std::vector<FilePath> getSubDirectories(const FilePath& path);
static bool exists(const std::string& path);
+3 -2
View File
@@ -1,9 +1,10 @@
#include "FileLogger.h"
#include <direct.h>
#include <fstream>
#include <sstream>
#include "utility/file/FileSystem.h"
std::string FileLogger::s_filePath = "data/log/";
FileLogger::FileLogger()
@@ -56,7 +57,7 @@ void FileLogger::createDirectory()
{
if (s_filePath.length() > 0)
{
mkdir(s_filePath.c_str());
FileSystem::createDirectory(s_filePath);
}
}