Code::Blocks  SVN r11506
compilerfactory.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3
3  * http://www.gnu.org/licenses/lgpl-3.0.html
4  */
5 
6 #ifndef COMPILERFACTORY_H
7 #define COMPILERFACTORY_H
8 
9 #ifndef CB_PRECOMP
10  #include <wx/arrstr.h> // WX_DEFINE_ARRAY
11  #include "compiler.h" // Compiler
12 #endif
13 
14 #include "settings.h"
15 
16 class Compiler;
17 
18 // Well, not really a factory ;)
19 
20 WX_DEFINE_ARRAY(Compiler*, CompilersArray);
21 
23 {
24  public:
26  static size_t GetCompilersCount();
28  static Compiler* GetCompiler(size_t index);
30  static Compiler* GetCompiler(const wxString& id);
32  static Compiler* GetCompilerByName(const wxString& title);
33 
35  static int GetCompilerIndex(const wxString& id);
37  static int GetCompilerIndex(Compiler* compiler);
38 
40  static bool IsValidCompilerID(const wxString& id){ return GetCompilerIndex(id) != -1; }
41 
43  static bool CompilerInheritsFrom(const wxString& id, const wxString& from_id);
45  static bool CompilerInheritsFrom(Compiler* compiler, const wxString& from_id);
46 
48  static void RegisterCompiler(Compiler* compiler);
50  static void RegisterUserCompilers();
52  static Compiler* CreateCompilerCopy(Compiler* compiler, const wxString& newName);
54  static void RemoveCompiler(Compiler* compiler);
56  static void UnregisterCompilers();
58  static wxString GetCompilerVersionString(const wxString& Id);
59 
60  static void SaveSettings();
61  static void LoadSettings();
62 
63  static const wxString& GetDefaultCompilerID();
64  static Compiler* GetDefaultCompiler();
65  static void SetDefaultCompiler(size_t index);
66  static void SetDefaultCompiler(const wxString& id);
67  static void SetDefaultCompiler(Compiler* compiler);
68 
69  static Compiler* SelectCompilerUI(const wxString& message = _("Select compiler"), const wxString& preselectedID = wxEmptyString);
70  private:
71  static CompilersArray Compilers;
73 };
74 
75 #endif // COMPILERFACTORY_H
static bool IsValidCompilerID(const wxString &id)
#define DLLIMPORT
Definition: settings.h:16
wxString wxEmptyString
const wxString & _(const wxString &string)
WX_DEFINE_ARRAY(Compiler *, CompilersArray)
Abstract base class for compilers.
Definition: compiler.h:274
static Compiler * s_DefaultCompiler
static CompilersArray Compilers