Fission FSN
Loading...
Searching...
No Matches
fsIResourceNamePathAdjuster.h
Go to the documentation of this file.
1/********************************************************************
2*
3* Created: 19/2/2014 17:08
4*
5* File: fsIResourceNamePathAdjuster.h
6*
7* Author: Mick Waites
8*
9* Purpose: Interface for platform specific file path adjuster.
10*
11*********************************************************************/
12
13#ifndef fsIResourceNamePathAdjusterhdr
14#define fsIResourceNamePathAdjusterhdr
15
16#include <set>
17#include <fsCore/fsBaseTypes.h>
19
20class fsCAppSettings;
21class fsIHardware;
22
24{
25public:
26
27 static const fsStr mPathSeparator;
28 static const fsStr mLayersFolder;
29
34
35 static void cacheFlush();
37
39
41 void chapterAdapterAdd(std::function<void(fsStr&, fsCResourceName::eResourceLocation)> pAdaptar);
43
45 void modify(fsStr& pPath, fsCResourceName::eResourceLocation pLocation, fsStr pTestDeviceStr);
46 void modify(fsStr& pPath, fsCResourceName::eResourceLocation pLocation);
47 void testModeTagetDeviceSet(const fsStr& pTargetTestDevice);
48
49 void init(fsCAppSettings* const pAppSettings, fsIHardware* const pHardware);
50
52
53protected:
54
55 virtual void initDo() {}
56 virtual void pathAdjustDo(fsStr& pPath, fsCResourceName::eResourceLocation pLocation) const{}
57 virtual void audioExtensionAdjustDo(fsStr& pPath, fsCResourceName::eResourceLocation pLocation) const {}
58 virtual void savedDataPathAdjustDo(fsStr& pPath, fsCResourceName::eResourceLocation pLocation) const {}
59 virtual void savedDataFolderCreateDo() const = 0;
60
62
66
67private:
68
69 void pathAdjust(fsStr& pPath, fsCResourceName::eResourceLocation pLocation) const;
70
71 static fsBool isUnadjustedSettingsFile(const fsStr& pPath);
72 void audioExtensionAdjust(fsStr& pPath, fsCResourceName::eResourceLocation pLocation) const;
73 void savedDataPathAdjust(fsStr& pPath, fsCResourceName::eResourceLocation pLocation) const;
74
75 void buildFlavourFilenameAdjust(fsStr& pPath, fsCResourceName::eResourceLocation pLocation) const;
76 void platformFilenameAdjust(fsStr& pPath, fsCResourceName::eResourceLocation pLocation) const;
77 void wideScreenMobileDevicePathAdjust(fsStr& pPath, fsCResourceName::eResourceLocation pLocation) const;
78 void publisherFilenameAdjust(fsStr& pPath, fsCResourceName::eResourceLocation pLocation) const;
79 void chapterFilenameAdjust(fsStr& pPath, fsCResourceName::eResourceLocation pLocation) const;
80
81 fsStr platformFilenameGet() const;
82
83 static void languageFilenameAdjust(fsStr& pPath, fsCResourceName::eResourceLocation pLocation);
84
85
86 static const fsStr mLayoutFileExt;
87
88 std::function<void(fsStr&, fsCResourceName::eResourceLocation)> mChapterAdapter;
89
90 void filenameCache(const fsStr& pFilename);
91
92#if !defined(fsRelease)
93 static std::set<fsStr> mFileCache;
94#endif
95};
96
97#endif
Definition fsCAppSettings.h:22
eResourceLocation
Definition fsCResourceName.h:36
Definition fsIHardware.h:25
virtual void audioExtensionAdjustDo(fsStr &pPath, fsCResourceName::eResourceLocation pLocation) const
Definition fsIResourceNamePathAdjuster.h:57
void chapterAdapterClear()
Definition fsIResourceNamePathAdjuster.cpp:60
virtual ~fsIResourceNamePathAdjuster()
Definition fsIResourceNamePathAdjuster.cpp:334
static fsStr localisedLevelLayersFolderGet()
Definition fsIResourceNamePathAdjuster.cpp:37
void savedDataFolderCreate()
Definition fsIResourceNamePathAdjuster.cpp:324
static const fsStr mLocaleFolderName
Definition fsIResourceNamePathAdjuster.h:33
static fsCAppSettings * mAppSettings
Definition fsIResourceNamePathAdjuster.h:65
static fsStr savedDataFolderGet()
Definition fsIResourceNamePathAdjuster.cpp:78
fsIResourceNamePathAdjuster()
Definition fsIResourceNamePathAdjuster.cpp:329
void testModeTagetDeviceSet(const fsStr &pTargetTestDevice)
Definition fsIResourceNamePathAdjuster.cpp:234
virtual void pathAdjustDo(fsStr &pPath, fsCResourceName::eResourceLocation pLocation) const
Definition fsIResourceNamePathAdjuster.h:56
static const fsStr mLayersFolder
Definition fsIResourceNamePathAdjuster.h:28
static void cacheFlush()
Definition fsIResourceNamePathAdjuster.cpp:339
virtual void initDo()
Definition fsIResourceNamePathAdjuster.h:55
void chapterAdapterAdd(std::function< void(fsStr &, fsCResourceName::eResourceLocation)> pAdaptar)
Definition fsIResourceNamePathAdjuster.cpp:55
static fsStr mTestMode
Definition fsIResourceNamePathAdjuster.h:63
static fsStr buildFlavourFilenameGet()
Definition fsIResourceNamePathAdjuster.cpp:73
static const fsStr mMacFileNameModifier
Definition fsIResourceNamePathAdjuster.h:30
void modify(fsStr &pPath, fsCResourceName::eResourceLocation pLocation, fsStr pTestDeviceStr)
Definition fsIResourceNamePathAdjuster.cpp:295
void init(fsCAppSettings *const pAppSettings, fsIHardware *const pHardware)
Definition fsIResourceNamePathAdjuster.cpp:47
virtual void savedDataFolderCreateDo() const =0
static const fsStr mPathSeparator
Definition fsIResourceNamePathAdjuster.h:27
static const fsStr mMobileFileNameModifier
Definition fsIResourceNamePathAdjuster.h:31
static fsIHardware * mHardware
Definition fsIResourceNamePathAdjuster.h:64
static const fsStr mPhoneWideScreenFileNameModifier
Definition fsIResourceNamePathAdjuster.h:32
virtual void savedDataPathAdjustDo(fsStr &pPath, fsCResourceName::eResourceLocation pLocation) const
Definition fsIResourceNamePathAdjuster.h:58
Definition fsStr.h:23
bool fsBool
Definition fsBaseTypes.h:26