-
-
Notifications
You must be signed in to change notification settings - Fork 829
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1642 from alicevision/dev/filesystemPath
Remove Boost-Filesystem and replace it with the `std::filesystem`
- Loading branch information
Showing
173 changed files
with
569 additions
and
639 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,10 +8,10 @@ | |
#include <aliceVision/image/io.hpp> | ||
#include <aliceVision/utils/regexFilter.hpp> | ||
|
||
#include <boost/filesystem.hpp> | ||
#include <boost/algorithm/string/case_conv.hpp> | ||
#include <boost/algorithm/string/replace.hpp> | ||
|
||
#include <filesystem> | ||
#include <queue> | ||
#include <iostream> | ||
#include <fstream> | ||
|
@@ -86,12 +86,12 @@ ImageFeed::FeederImpl::FeederImpl(const std::string& imagePath, const std::strin | |
: _isInit(false), | ||
_withCalibration(false) | ||
{ | ||
namespace bf = boost::filesystem; | ||
namespace fs = std::filesystem; | ||
// ALICEVISION_LOG_DEBUG(imagePath); | ||
// if it is a json, calibPath is neglected | ||
if (bf::is_regular_file(imagePath)) | ||
if (fs::is_regular_file(imagePath)) | ||
{ | ||
const std::string ext = bf::path(imagePath).extension().string(); | ||
const std::string ext = fs::path(imagePath).extension().string(); | ||
// if it is an image file | ||
if (image::isSupported(ext) && !image::isVideoExtension(ext)) | ||
{ | ||
|
@@ -111,7 +111,7 @@ ImageFeed::FeederImpl::FeederImpl(const std::string& imagePath, const std::strin | |
{ | ||
// compose the file name as the base path of the inputPath and | ||
// the filename just read | ||
const std::string filename = (bf::path(imagePath).parent_path() / line).string(); | ||
const std::string filename = (fs::path(imagePath).parent_path() / line).string(); | ||
_images.push_back(filename); | ||
} | ||
// Close file | ||
|
@@ -125,16 +125,16 @@ ImageFeed::FeederImpl::FeederImpl(const std::string& imagePath, const std::strin | |
throw std::invalid_argument("File or mode not yet implemented"); | ||
} | ||
} | ||
else if (bf::is_directory(imagePath) || bf::is_directory(bf::path(imagePath).parent_path())) | ||
else if (fs::is_directory(imagePath) || fs::is_directory(fs::path(imagePath).parent_path())) | ||
{ | ||
std::string folder = imagePath; | ||
// Recover the pattern : [email protected] (for example) | ||
std::string filePattern; | ||
std::regex re; | ||
if (!bf::is_directory(imagePath)) | ||
if (!fs::is_directory(imagePath)) | ||
{ | ||
filePattern = bf::path(imagePath).filename().string(); | ||
folder = bf::path(imagePath).parent_path().string(); | ||
filePattern = fs::path(imagePath).filename().string(); | ||
folder = fs::path(imagePath).parent_path().string(); | ||
ALICEVISION_LOG_DEBUG("filePattern: " << filePattern); | ||
std::string regexStr = filePattern; | ||
re = utils::filterToRegex(regexStr); | ||
|
@@ -145,12 +145,12 @@ ImageFeed::FeederImpl::FeederImpl(const std::string& imagePath, const std::strin | |
} | ||
ALICEVISION_LOG_DEBUG("directory feedImage"); | ||
// if it is a directory, list all the images and add them to the list | ||
bf::directory_iterator iterator(folder); | ||
fs::directory_iterator iterator(folder); | ||
// since some OS will provide the files in a random order, first store them | ||
// in a priority queue and then fill the _image queue with the alphabetical | ||
// order from the priority queue | ||
std::priority_queue<std::string, std::vector<std::string>, std::greater<std::string>> tmpSorter; | ||
for (; iterator != bf::directory_iterator(); ++iterator) | ||
for (; iterator != fs::directory_iterator(); ++iterator) | ||
{ | ||
// get the extension of the current file to check whether it is an image | ||
const std::string ext = iterator->path().extension().string(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.