switch back to boost::filesystem to avoid the requirement of c++17

This commit is contained in:
Chunting Gu
2020-09-07 19:01:31 +08:00
parent e7f88da2b2
commit 84476f75f7
31 changed files with 175 additions and 192 deletions
+6 -2
View File
@@ -1,5 +1,7 @@
#include "webcc/parser.h"
#include "boost/filesystem/operations.hpp"
#include "webcc/logger.h"
#include "webcc/message.h"
#include "webcc/string.h"
@@ -9,6 +11,8 @@
#include "webcc/gzip.h"
#endif
namespace bfs = boost::filesystem;
namespace webcc {
// -----------------------------------------------------------------------------
@@ -65,7 +69,7 @@ bool StringBodyHandler::Finish() {
bool FileBodyHandler::OpenFile() {
try {
temp_path_ = std::filesystem::temp_directory_path();
temp_path_ = bfs::temp_directory_path();
// Generate a random string as file name.
// A replacement of boost::filesystem::unique_path().
@@ -74,7 +78,7 @@ bool FileBodyHandler::OpenFile() {
LOG_VERB("Generate a temp path for streaming: %s",
temp_path_.string().c_str());
} catch (const std::filesystem::filesystem_error&) {
} catch (const bfs::filesystem_error&) {
LOG_ERRO("Failed to generate temp path for streaming.");
return false;
}