本文整理汇总了C++中PluginInfo::is_plugin_activated方法的典型用法代码示例。如果您正苦于以下问题:C++ PluginInfo::is_plugin_activated方法的具体用法?C++ PluginInfo::is_plugin_activated怎么用?C++ PluginInfo::is_plugin_activated使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginInfo
的用法示例。
在下文中一共展示了PluginInfo::is_plugin_activated方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
static void
init_logline_generator(GPtrArray *plugin_array)
{
if (!plugin_array)
return;
gboolean require_framing = FALSE;
for (int i=0; i < plugin_array->len; i++)
{
PluginInfo *plugin = g_ptr_array_index(plugin_array,i);
if (!plugin)
continue;
/* check if any active plugin requires framing */
if (plugin->require_framing && plugin->is_plugin_activated())
{
require_framing = TRUE;
break;
}
}
int framing;
if (syslog_proto && !noframing)
framing = 1;
else if (!syslog_proto && require_framing && !noframing)
framing = 1;
else
framing = 0;
prepare_log_line_template(
syslog_proto,
framing,
global_plugin_option.message_length,
sdata_value);
}
示例2: ERROR
static int
start_plugins(GPtrArray *plugin_array)
{
if (!plugin_array)
{
ERROR("invalid reference for plugin_array\n");
return 0;
}
/* check plugins to see how many is activated by command line parameters */
int number_of_active_plugins = 0;
for (int i=0; i < plugin_array->len; i++)
{
PluginInfo *plugin = g_ptr_array_index(plugin_array,i);
if (!plugin)
continue;
if (plugin->is_plugin_activated())
number_of_active_plugins++;
}
if (number_of_active_plugins != 1)
{
ERROR("%d plugins activated. You should activate exactly one plugin at a time.\nDid you forget to add -S ?\nSee \"loggen --help-all\" for available plugin options\n",
number_of_active_plugins);
return 0;
}
for (int i=0; i < plugin_array->len; i++)
{
PluginInfo *plugin = g_ptr_array_index(plugin_array,i);
if (!plugin)
continue;
if (plugin->start_plugin && plugin->is_plugin_activated())
{
plugin->start_plugin((gpointer)&global_plugin_option);
break;
}
}
return number_of_active_plugins;
}