utility: creating directories with boost in FileSystem method
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user