Code::Blocks  SVN r11506
Static Public Member Functions | Static Private Attributes | List of all members
CompilerFactory Class Reference

#include <compilerfactory.h>

Collaboration diagram for CompilerFactory:

Static Public Member Functions

static size_t GetCompilersCount ()
 
static Compiler * GetCompiler (size_t index)
 
static Compiler * GetCompiler (const wxString &id)
 
static Compiler * GetCompilerByName (const wxString &title)
 
static int GetCompilerIndex (const wxString &id)
 
static int GetCompilerIndex (Compiler *compiler)
 
static bool IsValidCompilerID (const wxString &id)
 
static bool CompilerInheritsFrom (const wxString &id, const wxString &from_id)
 
static bool CompilerInheritsFrom (Compiler *compiler, const wxString &from_id)
 
static void RegisterCompiler (Compiler *compiler)
 Register a supported (builtin) compiler. More...
 
static void RegisterUserCompilers ()
 Register all user-defined compiler copies. More...
 
static Compiler * CreateCompilerCopy (Compiler *compiler, const wxString &newName)
 Create a copy of a compiler. More...
 
static void RemoveCompiler (Compiler *compiler)
 Remove a compiler. More...
 
static void UnregisterCompilers ()
 Unregister all compilers. More...
 
static wxString GetCompilerVersionString (const wxString &Id)
 get the version number as string for the compiler with the specified index More...
 
static void SaveSettings ()
 
static void LoadSettings ()
 
static const wxString & GetDefaultCompilerID ()
 
static Compiler * GetDefaultCompiler ()
 
static void SetDefaultCompiler (size_t index)
 
static void SetDefaultCompiler (const wxString &id)
 
static void SetDefaultCompiler (Compiler *compiler)
 
static Compiler * SelectCompilerUI (const wxString &message=_("Select compiler"), const wxString &preselectedID=wxEmptyString)
 

Static Private Attributes

static CompilersArray Compilers
 
static Compiler * s_DefaultCompiler = nullptr
 

Detailed Description

Definition at line 22 of file compilerfactory.h.

Member Function Documentation

◆ CompilerInheritsFrom() [1/2]

bool CompilerFactory::CompilerInheritsFrom ( const wxString &  id,
const wxString &  from_id 
)
static
Returns
true if compiler ID id inherits, directly or indirectly, from compiler ID from_id.

Definition at line 100 of file compilerfactory.cpp.

References GetCompiler().

Referenced by Wiz::AppendContainerWithSelectCompilers(), Wizard::FillCompilerControl(), Wiz::FillContainerWithSelectCompilers(), and ScriptBindings::RegisterBindings().

◆ CompilerInheritsFrom() [2/2]

bool CompilerFactory::CompilerInheritsFrom ( Compiler *  compiler,
const wxString &  from_id 
)
static
Returns
true if compiler inherits, directly or indirectly, from compiler ID from_id.

Definition at line 105 of file compilerfactory.cpp.

References _T, LogManager::DebugLog(), Manager::Get(), GetCompiler(), Compiler::GetID(), Manager::GetLogManager(), and Compiler::GetParentID().

◆ CreateCompilerCopy()

Compiler * CompilerFactory::CreateCompilerCopy ( Compiler *  compiler,
const wxString &  newName 
)
static

◆ GetCompiler() [1/2]

Compiler * CompilerFactory::GetCompiler ( size_t  index)
static
Returns
the compiler by an index.

Definition at line 32 of file compilerfactory.cpp.

References Compilers.

Referenced by NativeParser::AddCompilerDirs(), NativeParser::AddCompilerPredefinedMacrosGCC(), NativeParser::AddCompilerPredefinedMacrosVC(), cbProject::AddFile(), CompilerGCC::AddOutputLine(), Wiz::AppendContainerWithSelectCompilers(), DirectCommands::AreExternalDepsOutdated(), CompilerOptionsDlg::AutoDetectCompiler(), AutoDetectCompilers::AutoDetectCompilers(), CompilerICC::AutoDetectInstallationDir(), CompilerGCC::BuildStateManagement(), cbGetDynamicLinkerPathForTarget(), EditorManager::CollectDefines(), CompilerGCC::CompileFileDefault(), CompilerOptionsDlg::CompilerChanged(), CompilerInheritsFrom(), CompilerOptionsDlg::CompilerOptionsDlg(), CompilerGCC::CompilerValid(), ProjectLoader::ConvertLibraries(), CompilerGCC::DoCleanWithMake(), DebuggerGDB::DoDebug(), CompilerOptionsDlg::DoFillCompilerPrograms(), CompilerOptionsDlg::DoFillCompilerSets(), CompilerOptionsDlg::DoLoadOptions(), CompilerOptionsDlg::DoSaveCompilerDefinition(), CompilerOptionsDlg::DoSaveCompilerPrograms(), CompilerOptionsDlg::DoSaveOptions(), AdvancedCompilerOptionsDlg::EndModal(), ProjectLoader::ExportTargetAsProject(), Wiz::FillComboboxWithCompilers(), Wizard::FillCompilerControl(), ProjectFileOptionsDlg::FillCompilers(), Wiz::FillContainerWithSelectCompilers(), DebuggerManager::FindTargetsDebugger(), CompilerCommandGenerator::GenerateCommandLine(), CompileTargetBase::GenerateTargetFilename(), DirectCommands::GetCompileFileCommand(), Wiz::GetCompilerFromCombobox(), GetCompilerVersionString(), CompilerGCC::GetCurrentCompilerID(), CompilerGCC::GetMakeCommandFor(), DirectCommands::GetPostBuildCommands(), DirectCommands::GetPreBuildCommands(), CompileTargetBase::GetStaticLibFilename(), DirectCommands::GetTargetCleanCommands(), DirectCommands::GetTargetLinkCommands(), ProjectLoader::GetValidCompilerID(), CompilerOptionsDlg::GetVarsOwner(), CompilerCommandGenerator::Init(), DirectCommands::IsObjectOutdated(), TemplateManager::NewProjectFromUserTemplate(), CompilerOptionsDlg::OnAddCompilerClick(), CompilerOptionsDlg::OnAdvancedClick(), CompilerGCC::OnCleanFile(), CompilerOptionsDlg::OnEditCompilerClick(), CompilerOptionsDlg::OnFlagsPopup(), CompilerGCC::OnJobEnd(), AutoDetectCompilers::OnMouseMotion(), ProjectOptionsDlg::OnProjectTypeChanged(), AdvancedCompilerOptionsDlg::OnRegexDefaults(), AdvancedCompilerOptionsDlg::OnRegexTest(), CompilerOptionsDlg::OnRemoveCompilerClick(), CompilerOptionsDlg::OnResetCompilerClick(), CompilerOptionsDlg::OnTreeSelectionChange(), CompilerOptionsDlg::OnUpdateUI(), CompilerOptionsDlg::OptionsToText(), CompilerGCC::PrintBanner(), ProjectOptionsDlg::ProjectOptionsDlg(), AdvancedCompilerOptionsDlg::ReadCompilerOptions(), MacrosManager::RecalcVars(), RegisterUserCompilers(), ProjectFileOptionsDlg::SaveBuildCommandSelection(), cbProject::SetCompilerID(), SetDefaultCompiler(), ProjectFile::SetObjName(), CompilerGCC::SetupEnvironment(), CompilerGCC::SwitchCompiler(), CompilerOptionsDlg::TextToOptions(), pfDetails::Update(), ProjectFileOptionsDlg::UpdateBuildCommand(), CompilerOptionsDlg::UpdateCompilerForTargets(), CompilerGCC::UseMake(), and AdvancedCompilerOptionsDlg::WriteCompilerOptions().

◆ GetCompiler() [2/2]

Compiler * CompilerFactory::GetCompiler ( const wxString &  id)
static
Returns
the compiler by a name (ID). Not the compiler's title...

Definition at line 42 of file compilerfactory.cpp.

References Compilers, wxString::IsSameAs(), wxString::Lower(), wxString::Replace(), wxEmptyString, and wxT.

◆ GetCompilerByName()

Compiler * CompilerFactory::GetCompilerByName ( const wxString &  title)
static

◆ GetCompilerIndex() [1/2]

int CompilerFactory::GetCompilerIndex ( const wxString &  id)
static

◆ GetCompilerIndex() [2/2]

int CompilerFactory::GetCompilerIndex ( Compiler *  compiler)
static
Returns
the compiler's index. Returns -1 if it doesn't exist.

Definition at line 90 of file compilerfactory.cpp.

References Compilers.

◆ GetCompilersCount()

size_t CompilerFactory::GetCompilersCount ( )
static

◆ GetCompilerVersionString()

wxString CompilerFactory::GetCompilerVersionString ( const wxString &  Id)
static

get the version number as string for the compiler with the specified index

Definition at line 335 of file compilerfactory.cpp.

References GetCompiler().

Referenced by ScriptBindings::RegisterBindings().

◆ GetDefaultCompiler()

Compiler * CompilerFactory::GetDefaultCompiler ( )
static

◆ GetDefaultCompilerID()

const wxString & CompilerFactory::GetDefaultCompilerID ( )
static

◆ IsValidCompilerID()

static bool CompilerFactory::IsValidCompilerID ( const wxString &  id)
inlinestatic
Returns
true if the specified compiler ID is valid, false if not.

Definition at line 40 of file compilerfactory.h.

References _(), and wxEmptyString.

Referenced by CompilerGCC::GetMakeCommandFor(), and ScriptBindings::RegisterBindings().

◆ LoadSettings()

void CompilerFactory::LoadSettings ( )
static

◆ RegisterCompiler()

void CompilerFactory::RegisterCompiler ( Compiler *  compiler)
static

Register a supported (builtin) compiler.

Definition at line 132 of file compilerfactory.cpp.

References Compilers, Compiler::m_Weight, and s_DefaultCompiler.

Referenced by CreateCompilerCopy(), and CompilerGCC::DoRegisterCompilers().

◆ RegisterUserCompilers()

void CompilerFactory::RegisterUserCompilers ( )
static

◆ RemoveCompiler()

void CompilerFactory::RemoveCompiler ( Compiler *  compiler)
static

◆ SaveSettings()

void CompilerFactory::SaveSettings ( )
static

◆ SelectCompilerUI()

Compiler * CompilerFactory::SelectCompilerUI ( const wxString &  message = _("Select compiler"),
const wxString &  preselectedID = wxEmptyString 
)
static

◆ SetDefaultCompiler() [1/3]

void CompilerFactory::SetDefaultCompiler ( size_t  index)
static

◆ SetDefaultCompiler() [2/3]

void CompilerFactory::SetDefaultCompiler ( const wxString &  id)
static

Definition at line 236 of file compilerfactory.cpp.

References GetCompiler(), and SetDefaultCompiler().

◆ SetDefaultCompiler() [3/3]

void CompilerFactory::SetDefaultCompiler ( Compiler *  compiler)
static

Definition at line 242 of file compilerfactory.cpp.

References s_DefaultCompiler.

◆ UnregisterCompilers()

void CompilerFactory::UnregisterCompilers ( )
static

Member Data Documentation

◆ Compilers

CompilersArray CompilerFactory::Compilers
staticprivate

◆ s_DefaultCompiler

Compiler * CompilerFactory::s_DefaultCompiler = nullptr
staticprivate

The documentation for this class was generated from the following files: