replace boost filesystem with std filesystem; upgrade gtest and find it using cmake.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#include <filesystem>
|
||||
#include <iostream>
|
||||
|
||||
#include "boost/filesystem/operations.hpp"
|
||||
|
||||
#include "webcc/logger.h"
|
||||
#include "webcc/server.h"
|
||||
|
||||
@@ -28,16 +27,17 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
std::uint16_t port = static_cast<std::uint16_t>(std::atoi(argv[1]));
|
||||
|
||||
bfs::path upload_dir = argv[2];
|
||||
if (!bfs::is_directory(upload_dir) || !bfs::exists(upload_dir)) {
|
||||
std::filesystem::path upload_dir = argv[2];
|
||||
if (!std::filesystem::is_directory(upload_dir) ||
|
||||
!std::filesystem::exists(upload_dir)) {
|
||||
std::cerr << "Invalid upload dir!" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Add a sub-dir for book photos.
|
||||
bfs::path photo_dir = upload_dir / "books";
|
||||
if (!bfs::exists(photo_dir)) {
|
||||
bfs::create_directory(photo_dir);
|
||||
std::filesystem::path photo_dir = upload_dir / "books";
|
||||
if (!std::filesystem::exists(photo_dir)) {
|
||||
std::filesystem::create_directory(photo_dir);
|
||||
}
|
||||
|
||||
std::cout << "Book photos will be saved to: " << photo_dir << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user