Start using std::filesystem::path for fusepath (#1522)
Some checks are pending
CodeQL / Analyze (push) Waiting to run
mkdocs / deploy (push) Waiting to run

This commit is contained in:
trapexit 2025-09-17 23:51:16 -04:00 • committed by GitHub
parent f64ff9ca1e
commit 8c649d33ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
139 changed files with 1711 additions and 1663 deletions

View file

@ -15,45 +15,3 @@
*/
#include "fs_path.hpp"
#include <string>
#include <dirent.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
using std::string;
string
fs::path::dirname(const char *path_)
{
string path(path_);
return fs::path::dirname(path);
}
string
fs::path::dirname(const string &path_)
{
std::size_t i;
i = path_.size() - 1;
while((i > 0) && (path_[i] == '/'))
i--;
while((i > 0) && (path_[i] != '/'))
i--;
while((i > 0) && (path_[i] == '/'))
i--;
return path_.substr(0,i+1);
}
string
fs::path::basename(const string &path_)
{
return path_.substr(path_.find_last_of('/')+1);
}