mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 01:23:51 +00:00
refactor path mapper
This commit is contained in:
parent
5542cbaa02
commit
1e464dd513
3 changed files with 13 additions and 194 deletions
|
|
@ -6,7 +6,7 @@ namespace wowee {
|
|||
namespace tools {
|
||||
|
||||
/**
|
||||
* Maps WoW virtual paths to reorganized filesystem categories.
|
||||
* Maps WoW virtual paths to organized filesystem categories.
|
||||
*
|
||||
* Input: WoW virtual path (e.g., "Creature\\Bear\\BearSkin.blp")
|
||||
* Output: Category-based relative path (e.g., "creature/bear/BearSkin.blp")
|
||||
|
|
@ -14,19 +14,15 @@ namespace tools {
|
|||
class PathMapper {
|
||||
public:
|
||||
/**
|
||||
* Map a WoW virtual path to a reorganized filesystem path.
|
||||
* Map a WoW virtual path to a organized filesystem path.
|
||||
* @param wowPath Original WoW virtual path (backslash-separated)
|
||||
* @return Reorganized relative path (forward-slash separated, fully lowercased)
|
||||
* @return Organized relative path (forward-slash separated, fully lowercased)
|
||||
*/
|
||||
static std::string mapPath(const std::string& wowPath);
|
||||
|
||||
private:
|
||||
static std::string mapPathImpl(const std::string& wowPath);
|
||||
// Helpers for prefix matching (case-insensitive)
|
||||
static bool startsWithCI(const std::string& str, const std::string& prefix);
|
||||
static std::string toLower(const std::string& str);
|
||||
static std::string toForwardSlash(const std::string& str);
|
||||
static std::string extractAfterPrefix(const std::string& path, size_t prefixLen);
|
||||
};
|
||||
|
||||
} // namespace tools
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue