add a cmake option to switch between std and boost filesystem

This commit is contained in:
Chunting Gu
2021-05-27 11:15:08 +08:00
parent 39719c4ded
commit df96f969bc
31 changed files with 227 additions and 195 deletions
+2 -5
View File
@@ -1,7 +1,6 @@
#include "webcc/parser.h"
#include "boost/algorithm/string.hpp"
#include "boost/filesystem/operations.hpp"
#include "webcc/logger.h"
#include "webcc/message.h"
@@ -12,8 +11,6 @@
#include "webcc/gzip.h"
#endif
namespace bfs = boost::filesystem;
namespace webcc {
// -----------------------------------------------------------------------------
@@ -70,7 +67,7 @@ bool StringBodyHandler::Finish() {
bool FileBodyHandler::OpenFile() {
try {
temp_path_ = bfs::temp_directory_path();
temp_path_ = fs::temp_directory_path();
// Generate a random string as file name.
// A replacement of boost::filesystem::unique_path().
@@ -79,7 +76,7 @@ bool FileBodyHandler::OpenFile() {
LOG_VERB("Generate a temp path for streaming: %s",
temp_path_.string().c_str());
} catch (const bfs::filesystem_error&) {
} catch (const fs::filesystem_error&) {
LOG_ERRO("Failed to generate temp path for streaming");
return false;
}