ASAPCabinetFE
 
Loading...
Searching...
No Matches
PathUtils Class Reference

Utility class for resolving file paths in ASAPCabinetFE. More...

#include <path_utils.h>

+ Collaboration diagram for PathUtils:

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)
 

Detailed Description

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.

Member Function Documentation

◆ getAudioPath()

std::string PathUtils::getAudioPath ( const std::string &  root,
const std::string &  musicPath 
)
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.

Parameters
rootThe base directory to start the path resolution.
musicPathThe path to the music file.
Returns
The resolved path as a string (valid path if exists, empty otherwise).
+ Here is the caller graph for this function:

◆ getImagePath()

std::string PathUtils::getImagePath ( const std::string &  root,
const std::string &  imagePath,
const std::string &  defaultImagePath 
)
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.

Parameters
rootThe base directory to start the path resolution.
imagePathThe custom path to the image file.
defaultImagePathThe fallback path if the custom path is invalid.
Returns
The resolved path as a string (custom if exists, default otherwise).
+ Here is the caller graph for this function:

◆ getVideoPath()

std::string PathUtils::getVideoPath ( const std::string &  root,
const std::string &  videoPath,
const std::string &  defaultVideoPath 
)
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.

Parameters
rootThe base directory to start the path resolution.
videoPathThe custom path to the video file.
defaultVideoPathThe fallback path if the custom path is invalid.
Returns
The resolved path as a string (custom if exists, default if exists, empty otherwise).
+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: