本文整理汇总了C++中PluginInfo::HasFlag方法的典型用法代码示例。如果您正苦于以下问题:C++ PluginInfo::HasFlag方法的具体用法?C++ PluginInfo::HasFlag怎么用?C++ PluginInfo::HasFlag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginInfo
的用法示例。
在下文中一共展示了PluginInfo::HasFlag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Load
//.........这里部分代码省略.........
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));
wxDELETE(dl);
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
wxDELETE(dl);
continue;
}
// If the plugin does not exist in the m_pluginsData, assume its the first time we see it
bool firstTimeLoading = (m_pluginsData.GetPlugins().count(pluginInfo->GetName()) == 0);
// Add the plugin information
m_pluginsData.AddPlugin((*pluginInfo));
if(firstTimeLoading && pluginInfo->HasFlag(PluginInfo::kDisabledByDefault)) {
m_pluginsData.DisablePlugin(pluginInfo->GetName());
wxDELETE(dl);
continue;
}
// Can we load it?
if(!m_pluginsData.CanLoad(*pluginInfo)) {
CL_WARNING(wxT("Plugin ") + pluginInfo->GetName() + wxT(" is not enabled"));
wxDELETE(dl);
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);
CL_DEBUG(wxT("Loaded plugin: ") + plugin->GetLongName());
m_plugins[plugin->GetShortName()] = plugin;
// Load the toolbar
clToolBar* tb = plugin->CreateToolBar(clMainFrame::Get()->GetDockingManager().GetManagedWindow());
if(tb) {