#include "fsCResourceNamePathAdjuster.h"
#include <filesystem>
#include <fsCore/src/fsCAppSettings.h>
#include <fsCore/fsIHardware.h>
#include <fsCore/fsIFile.h>
void fsCResourceNamePathAdjuster::savedDataFolderCreateDo() const
{
fsIFile::systemFolderCreate(savedDataFullFolderPathGet());
}
fsStr fsCResourceNamePathAdjuster::savedDataFullFolderPathGet() const<--- The member function 'fsCResourceNamePathAdjuster::savedDataFullFolderPathGet' can be static.
{
return mHardware->appDataFolderGet() + savedDataFolderGet();
}
void fsCResourceNamePathAdjuster::savedDataPathAdjustDo(fsStr& pPath,
fsCResourceName::eResourceLocation pLocation) const
{
if (pLocation == fsCResourceName::eRES_LOCATION_USER_SETTINGS)
{
// pPath = savedDataFullFolderPathGet() + pPath;
}
}
void fsCResourceNamePathAdjuster::audioExtensionAdjustDo(fsStr& pPath,
fsCResourceName::eResourceLocation pLocation) const
{
if (fsStr::npos != pPath.rfind(".wav") || fsStr::npos != pPath.rfind(".mp3"))
{
pPath.eraseFromLast(".");
pPath += ".ogg";
}
}
void fsCResourceNamePathAdjuster::pathAdjustDo(fsStr& pPath, fsCResourceName::eResourceLocation pLocation) const
{
#if defined fsPCStore
if (pPath.find(":") == fsStr::npos)
#else
if (pPath.find("/users/") == fsStr::npos && pPath.find("resources") == fsStr::npos)
#endif
{
const std::string workingDirectory = std::filesystem::current_path().string();
pPath = fsStr(workingDirectory.c_str()) + mPathSeparator + "Resources" + mPathSeparator + pPath;
}
pPath.replaceAll("\\", mPathSeparator);
pPath.downcase();
}
fsCResourceNamePathAdjuster::fsCResourceNamePathAdjuster()
{
}
fsCResourceNamePathAdjuster::~fsCResourceNamePathAdjuster()
{
}