Base: Remove Boost-based filesystem and switch to standard <filesystem>
This commit is contained in:
@@ -208,18 +208,18 @@ std::string FileInfo::getTempFileName(const char* FileName, const char* Path)
|
||||
#endif
|
||||
}
|
||||
|
||||
boost::filesystem::path FileInfo::stringToPath(const std::string& str)
|
||||
std::filesystem::path FileInfo::stringToPath(const std::string& str)
|
||||
{
|
||||
#if defined(FC_OS_WIN32)
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
|
||||
boost::filesystem::path path(converter.from_bytes(str));
|
||||
std::filesystem::path path(converter.from_bytes(str));
|
||||
#else
|
||||
boost::filesystem::path path(str);
|
||||
std::filesystem::path path(str);
|
||||
#endif
|
||||
return path;
|
||||
}
|
||||
|
||||
std::string FileInfo::pathToString(const boost::filesystem::path& path)
|
||||
std::string FileInfo::pathToString(const std::filesystem::path& path)
|
||||
{
|
||||
#if defined(FC_OS_WIN32)
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
|
||||
@@ -583,14 +583,14 @@ bool FileInfo::createDirectory() const
|
||||
bool FileInfo::createDirectories() const
|
||||
{
|
||||
try {
|
||||
boost::filesystem::path path(stringToPath(FileName));
|
||||
if (boost::filesystem::exists(path)) {
|
||||
std::filesystem::path path(stringToPath(FileName));
|
||||
if (std::filesystem::exists(path)) {
|
||||
return true;
|
||||
}
|
||||
boost::filesystem::create_directories(path);
|
||||
std::filesystem::create_directories(path);
|
||||
return true;
|
||||
}
|
||||
catch (const boost::filesystem::filesystem_error&) {
|
||||
catch (const std::filesystem::filesystem_error&) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user