本文整理汇总了C++中NameValueCollection::Add方法的典型用法代码示例。如果您正苦于以下问题:C++ NameValueCollection::Add方法的具体用法?C++ NameValueCollection::Add怎么用?C++ NameValueCollection::Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NameValueCollection
的用法示例。
在下文中一共展示了NameValueCollection::Add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: replyOutputFormat
void BatchFilter::replyOutputFormat( NameValueCollection& transportHeaders, int format )
{
XALAN_USING_XALAN( FormatterListener );
string formatAsString = "";
switch( format )
{
case FormatterListener::OUTPUT_METHOD_TEXT :
formatAsString = BatchFilter::OUTPUT_METHOD_TEXT;
break;
case FormatterListener::OUTPUT_METHOD_XML :
case FormatterListener::OUTPUT_METHOD_DOM :
formatAsString = BatchFilter::OUTPUT_METHOD_XML;
break;
default :
formatAsString = BatchFilter::OUTPUT_METHOD_NONE;
break;
}
if ( transportHeaders.ContainsKey( BatchOUTPUTFORMAT ) )
transportHeaders[ BatchOUTPUTFORMAT ] = formatAsString;
else
transportHeaders.Add( BatchOUTPUTFORMAT, formatAsString );
}
示例2: name_value_collection_Add
int name_value_collection_Add(lua_State *L) {
NameValueCollection *collection = GetCollection(L, lua_upvalueindex(1));
// TODO: permit nil
const char *name = luaL_checkstring(L, 1);
const char *value = luaL_checkstring(L, 2);
lua_pushboolean(L, collection->Add(name, value));
return 1;
}
示例3: internalEvalFunction
bool RoutingCondition::internalEvalFunction( RoutingMessage& message ) const
{
DEBUG( "Evaluating function" );
switch ( m_EvalFunction )
{
case RoutingCondition::VALIDATE_TO_XSD :
{
// local case vars block
// create an XSD filter
XSDFilter myFilter;
NameValueCollection headers;
headers.Add( XSDFilter::XSDFILE, m_EvalFunctionParams[ 0 ] );
if ( m_EvalFunctionParams.size() > 1 )
headers.Add( XSDFilter::XSDNAMESPACE, m_EvalFunctionParams[ 1 ] );
bool valid = true;
try
{
myFilter.ProcessMessage( message.getPayload()->getDoc(), headers, true );
}
catch( const XSDValidationException& ex )
{
TRACE( ex.getMessage() );
valid = false;
}
return m_Evaluator.EvaluateBool( valid );
}
case RoutingCondition::VALIDATE :
{
bool valid = true;
string options = "";
if ( m_EvalFunctionParams.size() > 0 )
options = m_EvalFunctionParams[ 0 ];
valid = Validate( options, message );
return m_Evaluator.EvaluateBool( valid );
}
case RoutingCondition::IS_ACK :
{
if ( m_EvalFunctionParams.size() == 0 )
return m_Evaluator.EvaluateBool( message.isAck() );
// hack for dd :
RoutingMessageEvaluator* evaluator = message.getPayloadEvaluator();
if ( ( evaluator != NULL ) && ( evaluator->CheckPayloadType( RoutingMessageEvaluator::ACHBLKACC ) ) )
{
return m_Evaluator.EvaluateBool( evaluator->isAck( m_EvalFunctionParams[ 0 ] ) );
}
DEBUG( "Condition failed because the message is not in the correct format for ACK(param) evaluation" );
return false;
}
case RoutingCondition::IS_NACK :
{
if ( m_EvalFunctionParams.size() == 0 )
return m_Evaluator.EvaluateBool( message.isNack() );
// hack for dd :
RoutingMessageEvaluator* evaluator = message.getPayloadEvaluator();
if ( ( evaluator != NULL ) && ( evaluator->CheckPayloadType( RoutingMessageEvaluator::ACHBLKRJCT ) ) )
{
return m_Evaluator.EvaluateBool( evaluator->isNack( m_EvalFunctionParams[ 0 ] ) );
}
DEBUG( "Condition failed because the message is not in the correct format for NACK(param) evaluation" );
return false;
}
case RoutingCondition::IS_REPLY :
return m_Evaluator.EvaluateBool( message.isReply() );
default :
// this should not happen ( function is parsed in ctor )
throw runtime_error( "Invalid function requested for evaluation." );
break;
}
return false;
}