本文整理汇总了C++中IProperties::add方法的典型用法代码示例。如果您正苦于以下问题:C++ IProperties::add方法的具体用法?C++ IProperties::add怎么用?C++ IProperties::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IProperties
的用法示例。
在下文中一共展示了IProperties::add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: proceed
/** \copydoc Option::proceed */
void proceed (const std::list<std::string>& args, IProperties& props)
{
props.add (0, getName(), args.front());
}
示例2: run
/*********************************************************************
** METHOD :
** PURPOSE :
** INPUT :
** OUTPUT :
** RETURN :
** REMARKS :
*********************************************************************/
IProperties* ToolComposite::run (int argc, char* argv[])
{
vector<IProperties*> inputs;
/** We first parse the options for all tools. */
for (list<Tool*>::iterator it = _tools.begin(); it != _tools.end(); it++)
{
#if 0
/** We get the parameters from the current parser. */
IProperties* input = (*it)->getParser()->parse (argc, argv);
/** We add the input into the vector that gather the tools inputs. */
inputs.push_back (input);
#else
try
{
/** We parse the user parameters. */
(*it)->getParser()->parse (argc, argv);
IProperties* input = (*it)->getParser()->getProperties() ;
/** We add the input into the vector that gather the tools inputs. */
inputs.push_back (input);
}
catch (OptionFailure& e)
{
IProperties* input = (*it)->getParser()->getProperties() ;
/** We add the input into the vector that gather the tools inputs. */
inputs.push_back (input);
// e.getParser().displayErrors (stdout);
// e.getParser().displayHelp (stdout);
// return NULL;
}
#endif
}
IProperties* output = 0;
size_t idx = 0;
for (list<Tool*>::iterator it = _tools.begin(); it != _tools.end(); it++, idx++)
{
/** We get the parameters from the current inputs entry. */
IProperties* input = inputs[idx];
/** We may have to add the output of the previous tool to the input of the current tool.
* WARNING! The output of the previous tool should have a bigger priority than the
* user parameters of the current tool.
*/
IProperties* actualInput = 0;
if (output != 0)
{
actualInput = new Properties();
actualInput->add (1, output); // output of the previous tool
actualInput->add (1, input); // input of the previous tool
}
else
{
actualInput = input;
}
/** We run the tool and get a reference on its output. */
output = (*it)->run (actualInput);
/** We add the current tool info to the global properties. */
_info->add (1, (*it)->getInfo());
}
/** We return the output properties. */
return _output;
}