@@ -0,0 +1,16 @@
|
||||
#include <utils/dirname.hpp>
|
||||
|
||||
namespace utils
|
||||
{
|
||||
std::string dirname(const std::string filename)
|
||||
{
|
||||
if (filename.empty())
|
||||
return "./";
|
||||
if (filename == ".." || filename == ".")
|
||||
return filename;
|
||||
auto pos = filename.rfind('/');
|
||||
if (pos == std::string::npos)
|
||||
return "./";
|
||||
return filename.substr(0, pos + 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
#include <string>
|
||||
|
||||
namespace utils
|
||||
{
|
||||
std::string dirname(const std::string filename);
|
||||
}
|
||||
@@ -10,5 +10,3 @@
|
||||
*/
|
||||
std::string xdg_config_path(const std::string& filename);
|
||||
std::string xdg_data_path(const std::string& filename);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user