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 void audioExtensionAdjust(fsStr& pPath, fsCResourceName::eResourceLocation pLocation) const;
71 void savedDataPathAdjust(fsStr& pPath, fsCResourceName::eResourceLocation pLocation) const;
72
73 void buildFlavourFilenameAdjust(fsStr& pPath, fsCResourceName::eResourceLocation pLocation) const;
74 void platformFilenameAdjust(fsStr& pPath, fsCResourceName::eResourceLocation pLocation) const;
75 void wideScreenMobileDevicePathAdjust(fsStr& pPath, fsCResourceName::eResourceLocation pLocation) const;
76 void publisherFilenameAdjust(fsStr& pPath, fsCResourceName::eResourceLocation pLocation) const;
77 void chapterFilenameAdjust(fsStr& pPath, fsCResourceName::eResourceLocation pLocation) const;
78
79 fsStr platformFilenameGet() const;
80
81 static void languageFilenameAdjust(fsStr& pPath, fsCResourceName::eResourceLocation pLocation);
82
83
84 static const fsStr mLayoutFileExt;
85
86 std::function<void(fsStr&, fsCResourceName::eResourceLocation)> mChapterAdapter;
87
88 void filenameCache(const fsStr& pFilename);
89
90#if !defined(fsRelease)
91 static std::set<fsStr> mFileCache;
92#endif
93};
94
95#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:317
static fsStr localisedLevelLayersFolderGet()
Definition fsIResourceNamePathAdjuster.cpp:37
void savedDataFolderCreate()
Definition fsIResourceNamePathAdjuster.cpp:307
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:312
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:322
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:278
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