ASAPCabinetFE
 
Loading...
Searching...
No Matches
path_utils.h
Go to the documentation of this file.
1
12#ifndef PATH_UTILS_H
13#define PATH_UTILS_H // Header guard to prevent multiple inclusions
14
15#include <string> // For std::string to represent file paths
16#include <nlohmann/json.hpp>
17#include <algorithm> // For std::remove_if, std::remove
18#include <cctype> // For std::iscntrl, std::isspace
19
30class PathUtils {
31public:
46 static std::string getImagePath(const std::string& root, const std::string& imagePath, const std::string& defaultImagePath);
47
61 static std::string getVideoPath(const std::string& root, const std::string& videoPath, const std::string& defaultVideoPath);
62
75 static std::string getAudioPath(const std::string& root, const std::string& musicPath);
76
77 // Directory finders
78 static bool getPupPath(const std::string& root);
79 static std::string getPinmamePath(const std::string& root);
80 static bool getAltcolorPath(const std::string& pinmamePath);
81 static bool getAltsoundPath(const std::string& pinmamePath);
82 static bool getAltMusic(const std::string& tableRoot);
83 static bool getUltraDmdPath(const std::string& tableRoot);
84 static std::string getRomPath(const std::string& pinmamePath, std::string& outRomName);
85
86
87private:
88 // Self helpers
89 static bool containsRegularFiles(const std::string& directoryPath);
90 static std::string findSubfolderCaseInsensitive(const std::string& parentPath, const std::string& targetFolderNameLowercase);
91 static std::string findSubfolderBySuffixCaseInsensitive(const std::string& parentPath, const std::string& targetSuffixLowercase);
92};
93
94#endif // PATH_UTILS_H
Utility class for resolving file paths in ASAPCabinetFE.
Definition path_utils.h:30
static std::string getAudioPath(const std::string &root, const std::string &musicPath)
Resolves the path to a music file.
Definition path_utils.cpp:43
static std::string getImagePath(const std::string &root, const std::string &imagePath, const std::string &defaultImagePath)
Resolves the path to an image file.
Definition path_utils.cpp:21
static std::string getVideoPath(const std::string &root, const std::string &videoPath, const std::string &defaultVideoPath)
Resolves the path to a video file.
Definition path_utils.cpp:32