Debian Codegraph @

code/datastructures/FSOExecutable.h

raw
1 /*
2 Copyright (C) 2009-2010 wxLauncher Team
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19 #ifndef FSOEXECUTABLE_H
20 #define FSOEXECUTABLE_H
21
22 #include <wx/wx.h>
23 #include <wx/clntdata.h>
24 #include <wx/filename.h>
25
26 class FSOExecutable: public wxClientData {
27 public:
28 enum Configuration {
29 CONFIG_RELEASE,
30 CONFIG_DEBUG,
31 CONFIG_FASTDEBUG
32 };
33
34 virtual ~FSOExecutable();
35 bool SupportsDirect3D();
36 bool SupportsOpenAL();
37
38 inline bool ExecutableNameEqualTo(const wxString& str) const;
39 inline const wxString& GetExecutableName() const;
40
41 static bool IsRootFolderValid(const wxFileName& path, bool quiet = false);
42 static bool HasFSOExecutables(const wxFileName& path);
43
44 static wxArrayString GetBinariesFromRootFolder(const wxFileName &path, bool quiet = false);
45 static wxArrayString GetFredBinariesFromRootFolder(const wxFileName &path, bool quiet = false);
46 static FSOExecutable GetBinaryVersion(wxString binaryname);
47 static bool SmellsLikeGitCommitHash(const wxString& str);
48 wxString GetVersionString() const;
49 protected:
50 int major;
51 int minor;
52 int revision;
53 bool inferno;
54 int sse;
55 bool _64bit;
56 Configuration configuration;
57 int build;
58 long year;
59 long month;
60 bool antipodes;
61 int antNumber; //!< antipodes number (such as 8)
62 wxString string;
63 wxString binaryname; //!< FS2 Open or FRED
64 wxString executablename; //!< the actual name of the binary
65 wxByte buildCaps;
66 private:
67 FSOExecutable();
68 static wxArrayString GetBinariesFromRootFolder(const wxFileName &path, const wxString &globPattern, bool quiet);
69 };
70
71 inline bool FSOExecutable::ExecutableNameEqualTo(const wxString& str) const {
72 return this->executablename == str;
73 }
74
75 inline const wxString& FSOExecutable::GetExecutableName() const {
76 return this->executablename;
77 }
78
79 #endif