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
+5 -4
View File
@@ -1,12 +1,13 @@
// A client posting multipart form data.
#include <filesystem>
#include <iostream>
#include "boost/filesystem/operations.hpp"
#include "webcc/client_session.h"
#include "webcc/logger.h"
namespace sfs = std::filesystem;
namespace bfs = boost::filesystem;
int main(int argc, char* argv[]) {
if (argc < 2) {
@@ -23,7 +24,7 @@ int main(int argc, char* argv[]) {
WEBCC_LOG_INIT("", webcc::LOG_CONSOLE);
const sfs::path upload_dir(argv[1]);
const bfs::path upload_dir(argv[1]);
std::string url;
if (argc == 3) {
@@ -32,7 +33,7 @@ int main(int argc, char* argv[]) {
url = "http://httpbin.org/post";
}
if (!sfs::is_directory(upload_dir) || !sfs::exists(upload_dir)) {
if (!bfs::is_directory(upload_dir) || !bfs::exists(upload_dir)) {
std::cerr << "Invalid upload dir!" << std::endl;
return 1;
}