comparison include/core/filesystem.h @ 59:327e9a5c72f1

filesystem: add basename and stem functions
author Paper <mrpapersonic@gmail.com>
date Thu, 28 Sep 2023 13:45:45 -0400
parents 4b05bc7668eb
children 327568ad9be9
comparison
equal deleted inserted replaced
58:b7a1c0010ffd 59:327e9a5c72f1
2 #define __core__filesystem_h 2 #define __core__filesystem_h
3 #include <string> 3 #include <string>
4 4
5 namespace Filesystem { 5 namespace Filesystem {
6 6
7 bool CreateDirectories(std::string path); 7 bool CreateDirectories(const std::string& path);
8 bool Exists(std::string path); 8 bool Exists(const std::string& path);
9 std::string GetParentDirectory(std::string path); 9 std::string Basename(const std::string& path);
10 std::string Stem(const std::string& path);
11 std::string GetParentDirectory(const std::string& path);
10 std::string GetDotPath(); // %APPDATA%/minori, ~/Library/Application Support/minori, ~/.config/minori... 12 std::string GetDotPath(); // %APPDATA%/minori, ~/Library/Application Support/minori, ~/.config/minori...
11 std::string GetConfigPath(); // (dotpath)/config.json 13 std::string GetConfigPath(); // (dotpath)/config.json
12 std::string GetAnimeDBPath(); // (dotpath)/anime/db.json 14 std::string GetAnimeDBPath(); // (dotpath)/anime/db.json
13 15
14 } // namespace Filesystem 16 } // namespace Filesystem