add a cmake option to switch between std and boost filesystem
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user