Utility class for resolving file paths in ASAPCabinetFE. More...
#include <path_utils.h>
Static Public Member Functions | |
static std::string | getImagePath (const std::string &root, const std::string &imagePath, const std::string &defaultImagePath) |
Resolves the path to an image file. | |
static std::string | getVideoPath (const std::string &root, const std::string &videoPath, const std::string &defaultVideoPath) |
Resolves the path to a video file. | |
static std::string | getAudioPath (const std::string &root, const std::string &musicPath) |
Resolves the path to a music file. | |
static bool | getPupPath (const std::string &root) |
static std::string | getPinmamePath (const std::string &root) |
static bool | getAltcolorPath (const std::string &pinmamePath) |
static bool | getAltsoundPath (const std::string &pinmamePath) |
static bool | getAltMusic (const std::string &tableRoot) |
static bool | getUltraDmdPath (const std::string &tableRoot) |
static std::string | getRomPath (const std::string &pinmamePath, std::string &outRomName) |
Utility class for resolving file paths in ASAPCabinetFE.
This class provides static methods to construct and validate file paths for images, videos, and music, starting from a root directory. It checks file existence and falls back to default paths when necessary, logging errors for missing defaults. The methods are configurable via input parameters and can be extended with configUI for user-defined path preferences.
|
static |
Resolves the path to a music file.
Constructs a path by combining the root directory with the provided musicPath. If the resulting file exists and is a regular file, its path is returned; otherwise, an empty string is returned with a debug log. This method lacks a default fallback and can be extended via configUI for additional options.
root | The base directory to start the path resolution. |
musicPath | The path to the music file. |
|
static |
Resolves the path to an image file.
Constructs a path by combining the root directory with the provided imagePath. If the resulting file exists, its path is returned; otherwise, it falls back to defaultImagePath, logging an error if the default is also missing. This method supports configurable image paths and can be enhanced via configUI for custom defaults.
root | The base directory to start the path resolution. |
imagePath | The custom path to the image file. |
defaultImagePath | The fallback path if the custom path is invalid. |
|
static |
Resolves the path to a video file.
Constructs a path by combining the root directory with the provided videoPath. If the resulting file exists, its path is returned; if not, it checks defaultVideoPath and returns it if valid, otherwise returns an empty string. This method is configurable and supports future configUI customization.
root | The base directory to start the path resolution. |
videoPath | The custom path to the video file. |
defaultVideoPath | The fallback path if the custom path is invalid. |