本文整理汇总了C++中PluginInfo::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ PluginInfo::GetName方法的具体用法?C++ PluginInfo::GetName怎么用?C++ PluginInfo::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginInfo
的用法示例。
在下文中一共展示了PluginInfo::GetName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Initialize
void PluginMgrDlg::Initialize()
{
clConfig conf("plugins.conf");
PluginInfoArray plugins;
conf.ReadItem(&plugins);
m_initialDisabledPlugins = plugins.GetDisabledPlugins();
std::sort(m_initialDisabledPlugins.begin(), m_initialDisabledPlugins.end());
const PluginInfo::PluginMap_t& pluginsMap = plugins.GetPlugins();
// Clear the list
m_checkListPluginsList->Clear();
PluginInfo::PluginMap_t::const_iterator iter = pluginsMap.begin();
for(; iter != pluginsMap.end(); ++iter) {
PluginInfo info = iter->second;
int item = m_checkListPluginsList->Append(info.GetName());
if(item != wxNOT_FOUND) {
m_checkListPluginsList->Check((unsigned int)item, plugins.CanLoad(info.GetName()));
}
}
if(m_checkListPluginsList->IsEmpty() == false) {
m_checkListPluginsList->Select(0);
CreateInfoPage(0);
}
m_checkListPluginsList->SetFocus();
}
示例2: AddPlugin
void PluginInfoArray::AddPlugin(const PluginInfo& plugin)
{
if ( m_plugins.count(plugin.GetName()) )
m_plugins.erase(plugin.GetName());
m_plugins.insert(std::make_pair(plugin.GetName(), plugin));
}
示例3: CanLoad
bool PluginInfoArray::CanLoad(const PluginInfo& plugin) const
{
if(m_disabledPlugins.Index(plugin.GetName()) != wxNOT_FOUND) {
// If the plugin is in the "disabled plugins" list - return false
return false;
}
return true;
}
示例4: FromJSON
void PluginInfoArray::FromJSON(const JSONElement& json)
{
m_disabledPlugins = json.namedObject("disabledPlugins").toArrayString();
m_plugins.clear();
JSONElement arr = json.namedObject("installed-plugins");
for(int i=0; i<arr.arraySize(); ++i) {
PluginInfo pi;
pi.FromJSON( arr.arrayItem(i) );
m_plugins.insert(std::make_pair(pi.GetName(), pi));
}
}
示例5: Load
//.........这里部分代码省略.........
bool success(false);
GET_PLUGIN_INFO_FUNC pfnGetPluginInfo = (GET_PLUGIN_INFO_FUNC)dl->GetSymbol(wxT("GetPluginInfo"), &success);
if(!success) {
continue;
}
// load the plugin version method
// if the methods does not exist, handle it as if it has value of 100 (lowest version API)
int interface_version(100);
GET_PLUGIN_INTERFACE_VERSION_FUNC pfnInterfaceVersion =
(GET_PLUGIN_INTERFACE_VERSION_FUNC)dl->GetSymbol(wxT("GetPluginInterfaceVersion"), &success);
if(success) {
interface_version = pfnInterfaceVersion();
} else {
CL_WARNING(wxT("Failed to find GetPluginInterfaceVersion() in dll: ") + fileName);
if(!dl->GetError().IsEmpty()) {
CL_WARNING(dl->GetError());
}
}
if(interface_version != PLUGIN_INTERFACE_VERSION) {
CL_WARNING(wxString::Format(wxT("Version interface mismatch error for plugin '%s'. Plugin's interface "
"version is '%d', CodeLite interface version is '%d'"),
fileName.c_str(),
interface_version,
PLUGIN_INTERFACE_VERSION));
continue;
}
// Check if this dll can be loaded
PluginInfo pluginInfo = pfnGetPluginInfo();
wxString pname = pluginInfo.GetName();
pname.MakeLower().Trim().Trim(false);
// Check the policy
if(pp == CodeLiteApp::PP_FromList && allowedPlugins.Index(pname) == wxNOT_FOUND) {
// Policy is set to 'from list' and this plugin does not match any plugins from
// the list, don't allow it to be loaded
continue;
}
// Add the plugin information
m_pluginsData.AddPlugin(pluginInfo);
// Can we load it?
if(!m_pluginsData.CanLoad(pluginInfo.GetName())) {
CL_WARNING(wxT("Plugin ") + pluginInfo.GetName() + wxT(" is not enabled"));
continue;
}
// try and load the plugin
GET_PLUGIN_CREATE_FUNC pfn = (GET_PLUGIN_CREATE_FUNC)dl->GetSymbol(wxT("CreatePlugin"), &success);
if(!success) {
CL_WARNING(wxT("Failed to find CreatePlugin() in dll: ") + fileName);
if(!dl->GetError().IsEmpty()) {
CL_WARNING(dl->GetError());
}
m_pluginsData.DisablePlugin(pluginInfo.GetName());
continue;
}
// Construct the plugin
IPlugin* plugin = pfn((IManager*)this);
示例6: CreateInfoPage
void PluginMgrDlg::CreateInfoPage(unsigned int index)
{
clConfig conf("plugins.conf");
PluginInfoArray plugins;
conf.ReadItem(&plugins);
// get the plugin name
wxString pluginName = m_checkListPluginsList->GetString(index);
PluginInfo::PluginMap_t::const_iterator iter = plugins.GetPlugins().find(pluginName);
if(iter != plugins.GetPlugins().end()) {
PluginInfo info = iter->second;
wxString content;
content << wxT("<html><body>");
content << wxT("<table border=0 width=\"100%\" >");
// create line with the plugin name
content << wxT("<tr bgcolor=\"LIGHT GREY\">");
content << wxT("<td ALIGN=\"LEFT\" WIDTH=30%><font size=\"2\" "
"face=\"Verdana\"><strong>$(PluginName)</strong></font></td>");
content << wxT("<td ALIGN=\"LEFT\" ><font size=\"2\" face=\"Verdana\">") << info.GetName()
<< wxT("</font></td>");
content << wxT("</tr>");
// plugin author
content << wxT("<tr bgcolor=\"WHITE\">");
content << wxT(
"<td ALIGN=\"LEFT\" WIDTH=30%><font size=\"2\" face=\"Verdana\"><strong>$(Author)</strong></font></td>");
content << wxT("<td ALIGN=\"LEFT\" ><font size=\"2\" face=\"Verdana\">") << info.GetAuthor()
<< wxT("</font></td>");
content << wxT("</tr>");
// plugin version
content << wxT("<tr bgcolor=\"LIGHT GREY\">");
content << wxT(
"<td ALIGN=\"LEFT\" WIDTH=30%><font size=\"2\" face=\"Verdana\"><strong>$(Version)</strong></font></td>");
content << wxT("<td ALIGN=\"LEFT\" ><font size=\"2\" face=\"Verdana\">") << info.GetVersion()
<< wxT("</font></td>");
content << wxT("</tr>");
// plugin description
content << wxT("<tr bgcolor=\"WHITE\">");
content << wxT("<td ALIGN=\"LEFT\" WIDTH=30%><font size=\"2\" "
"face=\"Verdana\"><strong>$(Description)</strong></font></td>");
content << wxT("<td ALIGN=\"LEFT\" ><font size=\"2\" face=\"Verdana\">") << info.GetDescription()
<< wxT("</font></td>");
content << wxT("</tr>");
content << wxT("<tr bgcolor=\"LIGHT GREY\">");
content << wxT(
"<td ALIGN=\"LEFT\" WIDTH=30%><font size=\"2\" face=\"Verdana\"><strong>$(Status)</strong></font></td>");
content.Replace(wxT("$(PluginName)"), _("Plugin Name:"));
content.Replace(wxT("$(Author)"), _("Author:"));
content.Replace(wxT("$(Version)"), _("Version:"));
content.Replace(wxT("$(Description)"), _("Description:"));
content.Replace(wxT("$(Status)"), _("Status:"));
wxString status;
if(plugins.CanLoad(info.GetName())) {
status = wxT("<img src=\"$(InstallPath)/images/plugin_ok.png\" ></img>");
} else {
status = wxT("<img src=\"$(InstallPath)/images/plugin_not_ok.png\" > </img>");
}
status.Replace(wxT("$(InstallPath)"), ManagerST::Get()->GetStartupDirectory());
content << wxT("<td ALIGN=\"LEFT\" ><font size=\"2\" face=\"Verdana\">") << status << wxT("</font></td>");
content << wxT("</tr>");
content << wxT("</table><html><body>");
m_htmlWinDesc->SetPage(content);
}
}