本文整理汇总了C++中ConfigManager::ReadArrayString方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigManager::ReadArrayString方法的具体用法?C++ ConfigManager::ReadArrayString怎么用?C++ ConfigManager::ReadArrayString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigManager
的用法示例。
在下文中一共展示了ConfigManager::ReadArrayString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: XRCCTRL
CompilerSettingsDlg::CompilerSettingsDlg(wxWindow* parent)
{
wxXmlResource::Get()->LoadObject(this, parent, _T("dlgCompilerSettings"),_T("wxScrollingDialog"));
XRCCTRL(*this, "wxID_OK", wxButton)->SetDefault();
m_pImageList = new wxImageList(80, 80);
Connect(XRCID("nbMain"),wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING,wxListbookEventHandler(CompilerSettingsDlg::OnPageChanging));
Connect(XRCID("nbMain"),wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED, wxListbookEventHandler(CompilerSettingsDlg::OnPageChanged ));
// tab "Batch builds"
if (platform::windows)
XRCCTRL(*this, "txtBatchBuildsCmdLine", wxTextCtrl)->SetValue(Manager::Get()->GetConfigManager(_T("app"))->Read(_T("/batch_build_args"), appglobals::DefaultBatchBuildArgs));
else
XRCCTRL(*this, "txtBatchBuildsCmdLine", wxTextCtrl)->Enable(false);
// fill plugins list
ConfigManager *bbcfg = Manager::Get()->GetConfigManager(_T("plugins"));
wxArrayString bbplugins = bbcfg->ReadArrayString(_T("/batch_build_plugins"));
if (!bbplugins.GetCount())
{
// defaults
if (platform::windows)
bbplugins.Add(_T("compiler.dll"));
else
bbplugins.Add(_T("libcompiler.so"));
}
wxCheckListBox* clb = XRCCTRL(*this, "chkBBPlugins", wxCheckListBox);
clb->Clear();
clb->SetMinSize(wxSize(-1, 150));
const PluginElementsArray& plugins = Manager::Get()->GetPluginManager()->GetPlugins();
for (size_t i = 0; i < plugins.GetCount(); ++i)
{
PluginElement* elem = plugins[i];
if (!elem)
continue;
cbPlugin* plugin = elem->plugin;
if (!plugin || !plugin->IsAttached())
continue;
wxString filename = wxFileName(elem->fileName).GetFullName();
size_t index = clb->Append(elem->info.title);
// check item if any wildcard matches
for (size_t n = 0; n < bbplugins.GetCount(); ++n)
{
if (filename.CmpNoCase(bbplugins[n]) == 0)
{
clb->Check(index, plugin->IsAttached());
break;
}
}
}
// add all plugins configuration panels
AddPluginPanels();
// make sure everything is laid out properly
GetSizer()->SetSizeHints(this);
CentreOnParent();
Layout();
}
示例2: ReadDetectedResults
void ResultMap::ReadDetectedResults()
{
Clear();
ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("lib_finder"));
if ( !cfg ) return;
wxArrayString Results = cfg->EnumerateSubPaths(_T("/stored_results"));
for ( size_t i=0; i<Results.Count(); i++ )
{
wxString Path = _T("/stored_results/") + Results[i] + _T("/");
LibraryResult* Result = new LibraryResult();
Result->Type = rtDetected;
Result->LibraryName = cfg->Read(Path+_T("name"),wxEmptyString);
Result->ShortCode = cfg->Read(Path+_T("short_code"),wxEmptyString);
Result->BasePath = cfg->Read(Path+_T("base_path"),wxEmptyString);
Result->Description = cfg->Read(Path+_T("description"),wxEmptyString);
Result->PkgConfigVar = cfg->Read(Path+_T("pkg_config_var"),wxEmptyString);
Result->Categories = cfg->ReadArrayString(Path+_T("categories"));
Result->IncludePath = cfg->ReadArrayString(Path+_T("include_paths"));
Result->LibPath = cfg->ReadArrayString(Path+_T("lib_paths"));
Result->ObjPath = cfg->ReadArrayString(Path+_T("obj_paths"));
Result->Libs = cfg->ReadArrayString(Path+_T("libs"));
Result->Defines = cfg->ReadArrayString(Path+_T("defines"));
Result->CFlags = cfg->ReadArrayString(Path+_T("cflags"));
Result->LFlags = cfg->ReadArrayString(Path+_T("lflags"));
Result->Compilers = cfg->ReadArrayString(Path+_T("compilers"));
Result->Headers = cfg->ReadArrayString(Path+_T("headers"));
Result->Require = cfg->ReadArrayString(Path+_T("require"));
if ( Result->ShortCode.IsEmpty() )
{
delete Result;
continue;
}
GetShortCode(Result->ShortCode).Add(Result);
}
}
示例3: wxFlexGridSizer
DirListDlg::DirListDlg(wxWindow* parent,wxWindowID id)
{
//(*Initialize(DirListDlg)
wxButton* Button1;
wxButton* Button2;
wxStaticBoxSizer* StaticBoxSizer1;
Create(parent, id, _("List of directories with libraries"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("id"));
FlexGridSizer1 = new wxFlexGridSizer(0, 1, 0, 0);
StaticBoxSizer1 = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Scanned directories:"));
DirList = new wxTextCtrl(this, ID_TEXTCTRL1, wxEmptyString, wxDefaultPosition, wxSize(292,194), wxTE_MULTILINE, wxDefaultValidator, _T("ID_TEXTCTRL1"));
StaticBoxSizer1->Add(DirList, 1, wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer1 = new wxBoxSizer(wxVERTICAL);
Button1 = new wxButton(this, ID_BUTTON1, _("Add dir"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON1"));
BoxSizer1->Add(Button1, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxALIGN_CENTER_HORIZONTAL, 5);
Button2 = new wxButton(this, ID_BUTTON2, _("Clear All"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON2"));
BoxSizer1->Add(Button2, 0, wxLEFT|wxRIGHT|wxALIGN_CENTER_HORIZONTAL, 5);
StaticBoxSizer1->Add(BoxSizer1, 0, wxALIGN_TOP, 0);
FlexGridSizer1->Add(StaticBoxSizer1, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
Button3 = new wxButton(this, ID_BUTTON3, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON3"));
BoxSizer2->Add(Button3, 1, wxBOTTOM|wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5);
Button4 = new wxButton(this, ID_BUTTON4, _("Next"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON4"));
Button4->SetDefault();
BoxSizer2->Add(Button4, 1, wxBOTTOM|wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer1->Add(BoxSizer2, 1, wxALIGN_CENTER_VERTICAL, 0);
SetSizer(FlexGridSizer1);
FlexGridSizer1->Fit(this);
FlexGridSizer1->SetSizeHints(this);
Connect(ID_BUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&DirListDlg::OnButton1Click);
Connect(ID_BUTTON2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&DirListDlg::OnButton2Click);
Connect(ID_BUTTON3,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&DirListDlg::OnButton3Click);
Connect(ID_BUTTON4,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&DirListDlg::OnButton4Click);
//*)
ConfigManager* mgr = Manager::Get()->GetConfigManager( _T("lib_finder") );
wxArrayString DirsLoc = mgr->ReadArrayString(_T("search_dirs"));
DirList->SetValue( GetStringFromArray(DirsLoc, _T("\n")) );
}
示例4: ScanForPlugins
int PluginManager::ScanForPlugins(const wxString& path)
{
static const wxString PluginsMask = platform::windows ? _T("*.dll")
: (platform::darwin || platform::macosx) ? _T("*.dylib")
: _T("*.so");
int count = 0;
if (!wxDirExists(path))
return count;
wxDir dir(path);
if (!dir.IsOpened())
return count;
bool batch = Manager::IsBatchBuild();
wxArrayString bbplugins;
if (batch)
{
ConfigManager *bbcfg = Manager::Get()->GetConfigManager(_T("plugins"));
bbplugins = bbcfg->ReadArrayString(_T("/batch_build_plugins"));
if (!bbplugins.GetCount())
{
// defaults
if (platform::windows)
bbplugins.Add(_T("compiler.dll"));
else if (platform::darwin || platform::macosx)
bbplugins.Add(_T("libcompiler.dylib"));
else
bbplugins.Add(_T("libcompiler.so"));
}
}
wxString filename;
wxString failed;
bool ok = dir.GetFirst(&filename, PluginsMask, wxDIR_FILES);
while (ok)
{
if (batch)
{
// for batch builds, we will load only those plugins that the
// user has set (default only compiler.dll)
bool matched = false;
for (size_t i = 0; i < bbplugins.GetCount(); ++i)
{
if (bbplugins[i] == filename)
{
matched = true;
break;
}
}
if (!matched)
{
ok = dir.GetNext(&filename);
continue;
}
}
// load manifest
m_pCurrentlyLoadingManifestDoc = nullptr;
if (ReadManifestFile(filename))
{
if (LoadPlugin(path + wxFILE_SEP_PATH + filename))
++count;
else
failed << _T('\n') << filename;
}
if (m_pCurrentlyLoadingManifestDoc)
{
delete m_pCurrentlyLoadingManifestDoc;
m_pCurrentlyLoadingManifestDoc = nullptr;
}
ok = dir.GetNext(&filename);
}
Manager::Get()->GetLogManager()->Log(F(_("Loaded %d plugins"), count));
if (!failed.IsEmpty())
{
InfoWindow::Display(_("Warning"),
_("One or more plugins were not loaded.\n"
"This usually happens when a plugin is built for\n"
"a different version of the Code::Blocks SDK.\n"
"Check the application log for more info.\n\n"
"List of failed plugins:\n") + failed,
15000, 3000);
}
return count;
}
示例5: LoadSettings
void Compiler::LoadSettings(const wxString& baseKey)
{
// before loading any compiler settings, keep the current settings safe
// so we can compare them when saving: this way we can only save what's
// different from the defaults
MirrorCurrentSettings();
ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("compiler"));
// read settings version
wxString version = cfg->Read(_T("settings_version"));
bool versionMismatch = version != CompilerSettingsVersion;
wxString tmp;
// if using old-style keys (using integer IDs), notify user about the changes
static bool saidAboutCompilerIDs = false;
tmp.Printf(_T("%s/set%3.3d"), baseKey.c_str(), CompilerFactory::GetCompilerIndex(this) + 1);
if (cfg->Exists(tmp + _T("/name")))
{
if (!saidAboutCompilerIDs)
{
saidAboutCompilerIDs = true;
cbMessageBox(_("Compilers now use unique names instead of integer IDs.\n"
"Projects will be updated accordingly on load, mostly automatic."),
_("Information"),
wxICON_INFORMATION);
}
// at this point, we 'll be using the old style configuration to load settings
}
else // it's OK to use new style
tmp.Printf(_T("%s/%s"), baseKey.c_str(), m_ID.c_str());
if (!cfg->Exists(tmp + _T("/name")))
return;
wxString sep = wxFileName::GetPathSeparator();
m_Name = cfg->Read(tmp + _T("/name"), m_Name);
m_MasterPath = cfg->Read(tmp + _T("/master_path"), m_MasterPath);
m_ExtraPaths = MakeUniqueArray(GetArrayFromString(cfg->Read(tmp + _T("/extra_paths"), _T("")), _T(";")), true);
m_Programs.C = cfg->Read(tmp + _T("/c_compiler"), m_Programs.C);
m_Programs.CPP = cfg->Read(tmp + _T("/cpp_compiler"), m_Programs.CPP);
m_Programs.LD = cfg->Read(tmp + _T("/linker"), m_Programs.LD);
m_Programs.LIB = cfg->Read(tmp + _T("/lib_linker"), m_Programs.LIB);
m_Programs.WINDRES = cfg->Read(tmp + _T("/res_compiler"), m_Programs.WINDRES);
m_Programs.MAKE = cfg->Read(tmp + _T("/make"), m_Programs.MAKE);
m_Programs.DBG = cfg->Read(tmp + _T("/debugger"), m_Programs.DBG);
// set member variable containing the version string with the configurated toolchain executables, not only
// with the default ones, otherwise we might have an empty version-string
// Some MinGW installations do not includee "mingw32-gcc" !!
SetVersionString();
SetCompilerOptions (GetArrayFromString(cfg->Read(tmp + _T("/compiler_options"), wxEmptyString)));
SetLinkerOptions (GetArrayFromString(cfg->Read(tmp + _T("/linker_options"), wxEmptyString)));
SetIncludeDirs (GetArrayFromString(cfg->Read(tmp + _T("/include_dirs"), wxEmptyString)));
SetResourceIncludeDirs(GetArrayFromString(cfg->Read(tmp + _T("/res_include_dirs"), wxEmptyString)));
SetLibDirs (GetArrayFromString(cfg->Read(tmp + _T("/library_dirs"), wxEmptyString)));
SetLinkLibs (GetArrayFromString(cfg->Read(tmp + _T("/libraries"), wxEmptyString)));
SetCommandsBeforeBuild(GetArrayFromString(cfg->Read(tmp + _T("/commands_before"), wxEmptyString)));
SetCommandsAfterBuild (GetArrayFromString(cfg->Read(tmp + _T("/commands_after"), wxEmptyString)));
for (int i = 0; i < ctCount; ++i)
{
wxArrayString keys = cfg->EnumerateSubPaths(tmp + _T("/macros/") + CommandTypeDescriptions[i]);
for (size_t n = 0; n < keys.size(); ++n)
{
unsigned long index = 0;
if (keys[n].Mid(4).ToULong(&index)) // skip 'tool'
{
while (index >= m_Commands[i].size())
m_Commands[i].push_back(CompilerTool());
CompilerTool& tool = m_Commands[i][index];
wxString key = wxString::Format(_T("%s/macros/%s/tool%lu/"), tmp.c_str(), CommandTypeDescriptions[i].c_str(), index);
tool.command = cfg->Read(key + _T("command"));
tool.extensions = cfg->ReadArrayString(key + _T("extensions"));
tool.generatedFiles = cfg->ReadArrayString(key + _T("generatedFiles"));
}
}
}
// switches
m_Switches.includeDirs = cfg->Read(tmp + _T("/switches/includes"), m_Switches.includeDirs);
m_Switches.libDirs = cfg->Read(tmp + _T("/switches/libs"), m_Switches.libDirs);
m_Switches.linkLibs = cfg->Read(tmp + _T("/switches/link"), m_Switches.linkLibs);
m_Switches.defines = cfg->Read(tmp + _T("/switches/define"), m_Switches.defines);
m_Switches.genericSwitch = cfg->Read(tmp + _T("/switches/generic"), m_Switches.genericSwitch);
m_Switches.objectExtension = cfg->Read(tmp + _T("/switches/objectext"), m_Switches.objectExtension);
m_Switches.needDependencies = cfg->ReadBool(tmp + _T("/switches/deps"), m_Switches.needDependencies);
m_Switches.forceCompilerUseQuotes = cfg->ReadBool(tmp + _T("/switches/forceCompilerQuotes"), m_Switches.forceCompilerUseQuotes);
m_Switches.forceLinkerUseQuotes = cfg->ReadBool(tmp + _T("/switches/forceLinkerQuotes"), m_Switches.forceLinkerUseQuotes);
m_Switches.logging = (CompilerLoggingType)cfg->ReadInt(tmp + _T("/switches/logging"), m_Switches.logging);
m_Switches.libPrefix = cfg->Read(tmp + _T("/switches/libPrefix"), m_Switches.libPrefix);
m_Switches.libExtension = cfg->Read(tmp + _T("/switches/libExtension"), m_Switches.libExtension);
m_Switches.linkerNeedsLibPrefix = cfg->ReadBool(tmp + _T("/switches/linkerNeedsLibPrefix"), m_Switches.linkerNeedsLibPrefix);
m_Switches.linkerNeedsLibExtension = cfg->ReadBool(tmp + _T("/switches/linkerNeedsLibExtension"), m_Switches.linkerNeedsLibExtension);
m_Switches.forceFwdSlashes = cfg->ReadBool(tmp + _T("/switches/forceFwdSlashes"), m_Switches.forceFwdSlashes);
//.........这里部分代码省略.........
示例6: LoadConfig
void ThreadSearch::LoadConfig(bool& showPanel, int& sashPosition,
ThreadSearchViewManagerBase::eManagerTypes& mgrType,
wxArrayString& searchPatterns, wxArrayString& searchDirs, wxArrayString& searchMasks)
{
if ( !IsAttached() )
return;
ConfigManager* pCfg = Manager::Get()->GetConfigManager(_T("ThreadSearch"));
m_FindData.SetMatchWord (pCfg->ReadBool(wxT("/MatchWord"), true));
m_FindData.SetStartWord (pCfg->ReadBool(wxT("/StartWord"), false));
m_FindData.SetMatchCase (pCfg->ReadBool(wxT("/MatchCase"), true));
m_FindData.SetRegEx (pCfg->ReadBool(wxT("/RegEx"), false));
m_FindData.SetHiddenSearch (pCfg->ReadBool(wxT("/HiddenSearch"), true));
m_FindData.SetRecursiveSearch (pCfg->ReadBool(wxT("/RecursiveSearch"), true));
m_CtxMenuIntegration = pCfg->ReadBool(wxT("/CtxMenuIntegration"), true);
m_UseDefValsForThreadSearch = pCfg->ReadBool(wxT("/UseDefaultValues"), true);
m_ShowSearchControls = pCfg->ReadBool(wxT("/ShowSearchControls"), true);
m_ShowDirControls = pCfg->ReadBool(wxT("/ShowDirControls"), false);
m_ShowCodePreview = pCfg->ReadBool(wxT("/ShowCodePreview"), false);
m_DeletePreviousResults = pCfg->ReadBool(wxT("/DeletePreviousResults"), false);
m_DisplayLogHeaders = pCfg->ReadBool(wxT("/DisplayLogHeaders"), true);
m_DrawLogLines = pCfg->ReadBool(wxT("/DrawLogLines"), false);
m_AutosizeLogColumns = pCfg->ReadBool(wxT("/AutosizeLogColumns"), true);
showPanel = pCfg->ReadBool(wxT("/ShowPanel"), true);
m_FindData.SetScope (pCfg->ReadInt (wxT("/Scope"), ScopeProjectFiles));
m_FindData.SetSearchPath (pCfg->Read (wxT("/DirPath"), wxEmptyString));
m_FindData.SetSearchMask (pCfg->Read (wxT("/Mask"), wxT("*.cpp;*.c;*.h")));
sashPosition = pCfg->ReadInt(wxT("/SplitterPosn"), 0);
int splitterMode = pCfg->ReadInt(wxT("/SplitterMode"), wxSPLIT_VERTICAL);
m_SplitterMode = wxSPLIT_VERTICAL;
if ( splitterMode == wxSPLIT_HORIZONTAL )
{
m_SplitterMode = wxSPLIT_HORIZONTAL;
}
int managerType = pCfg->ReadInt(wxT("/ViewManagerType"), ThreadSearchViewManagerBase::TypeMessagesNotebook);
mgrType = ThreadSearchViewManagerBase::TypeMessagesNotebook;
if ( managerType == ThreadSearchViewManagerBase::TypeLayout )
{
mgrType = ThreadSearchViewManagerBase::TypeLayout;
}
int loggerType = pCfg->ReadInt(wxT("/LoggerType"), ThreadSearchLoggerBase::TypeList);
m_LoggerType = ThreadSearchLoggerBase::TypeList;
if ( loggerType == ThreadSearchLoggerBase::TypeTree )
{
m_LoggerType = ThreadSearchLoggerBase::TypeTree;
}
searchPatterns = pCfg->ReadArrayString(wxT("/SearchPatterns"));
searchDirs = pCfg->ReadArrayString(wxT("/SearchDirs"));
if (searchDirs.empty())
searchDirs.push_back(m_FindData.GetSearchPath());
searchMasks = pCfg->ReadArrayString(wxT("/SearchMasks"));
if (searchMasks.empty())
searchMasks.push_back(m_FindData.GetSearchMask());
}