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
+3 -6
View File
@@ -2,13 +2,10 @@
#include <iostream>
#include "boost/filesystem/operations.hpp"
#include "webcc/client_session.h"
#include "webcc/fs.h"
#include "webcc/logger.h"
namespace bfs = boost::filesystem;
int main(int argc, char* argv[]) {
if (argc < 2) {
std::cout << "Usage: form_client <upload_dir> [url]" << std::endl;
@@ -29,7 +26,7 @@ int main(int argc, char* argv[]) {
WEBCC_LOG_INIT("", webcc::LOG_CONSOLE);
const bfs::path upload_dir(argv[1]);
const webcc::fs::path upload_dir(argv[1]);
std::string url;
if (argc == 3) {
@@ -38,7 +35,7 @@ int main(int argc, char* argv[]) {
url = "http://httpbin.org/post";
}
if (!bfs::is_directory(upload_dir) || !bfs::exists(upload_dir)) {
if (!webcc::fs::is_directory(upload_dir) || !webcc::fs::exists(upload_dir)) {
std::cerr << "Invalid upload dir!" << std::endl;
return 1;
}