ScummVM API documentation
work_dirs.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef WATCHMAKER_WORK_DIRS_H
23 #define WATCHMAKER_WORK_DIRS_H
24 
25 #include "watchmaker/ll/ll_ffile.h"
26 #include "watchmaker/globvar.h"
27 
28 namespace Watchmaker {
29 
30 class WorkDirs {
32 public:
33  Common::String _gameDir = "./";
34  Common::String _halfLightmapsDir = "./";
35  Common::String _halfMapsDir = "./";
36  Common::String _initDir = "./";
37  Common::String _define = "./";
38 
39  // Setup Directories
40  Common::String _t3dDir = "./T3D/";
41  Common::String _bndDir = "./BND/";
42  Common::String _camDir = "./CAM/";
43  Common::String _mapsDir = "./TMaps/";
44  Common::String _moviesDir = "./Movies/"; //lo aggiorno in GetRegistrySettings()
45  Common::String _speechDir = ""; //lo aggiorno in GetRegistrySettings()
46  Common::String _lightmapsDir = "./LMaps/";
47  Common::String _miscDir = "./Misc/";
48  Common::String _a3dDir = "./A3D/";
49  Common::String _midiDir = "./MIDI/";
50  Common::String _savesDir = "./Saves/";
51  Common::String _wavDir = "./WAV/";
52 
53  Common::String join(const Common::String &first, const Common::String &second, Common::String extReplacement = "") {
54  Common::String result = first + second;
55 
56  // Hacky, and assumes the extensions are the same length.
57  return result.substr(0, result.size() - extReplacement.size()) + extReplacement;
58  }
59 
60  Common::String unwindowsify(const Common::String &str) const {
61  Common::String result; // TODO Rewrite
62  for (uint i = 0; i < str.size(); i++) {
63  if (str[i] != '\\') {
64  result += str[i];
65  } else {
66  result += "/";
67  }
68  }
69  return result;
70  }
71 
72  WorkDirs(const Common::String &filename);
73  Common::SharedPtr<Common::SeekableReadStream> resolveFile(const Common::String &path, bool noFastFile = false);
74 };
75 
76 } // End of namespace Watchmaker
77 
78 #endif // WATCHMAKER_WORK_DIRS_H
Definition: 2d_stuff.h:30
Definition: str.h:59
Definition: work_dirs.h:30
String substr(size_t pos=0, size_t len=npos) const
Definition: ptr.h:159