mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
Move everything to negative errno return types (#1499)
This commit is contained in:
parent
2b500f194a
commit
e8cd74cab0
177 changed files with 5952 additions and 5843 deletions
|
|
@ -26,40 +26,34 @@
|
|||
using std::string;
|
||||
|
||||
|
||||
namespace fs
|
||||
string
|
||||
fs::path::dirname(const char *path_)
|
||||
{
|
||||
namespace path
|
||||
{
|
||||
string
|
||||
dirname(const char *path_)
|
||||
{
|
||||
string path(path_);
|
||||
string path(path_);
|
||||
|
||||
return fs::path::dirname(path);
|
||||
}
|
||||
|
||||
string
|
||||
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
|
||||
basename(const string &path_)
|
||||
{
|
||||
return path_.substr(path_.find_last_of('/')+1);
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue