本文整理汇总了C++中KviKvsVariantList::allAsString方法的典型用法代码示例。如果您正苦于以下问题:C++ KviKvsVariantList::allAsString方法的具体用法?C++ KviKvsVariantList::allAsString怎么用?C++ KviKvsVariantList::allAsString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KviKvsVariantList
的用法示例。
在下文中一共展示了KviKvsVariantList::allAsString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
bool KviKvsTreeNodeParameterReturn::execute(KviKvsRunTimeContext * c)
{
KviKvsVariantList lBuffer;
if(!m_pDataList->evaluate(c, &lBuffer))
return false;
if(lBuffer.count() == 0)
{
c->returnValue()->setNothing();
return true;
}
if(lBuffer.count() == 1)
{
c->returnValue()->copyFrom(*(lBuffer.first()));
return true;
}
QString all;
lBuffer.allAsString(all);
c->returnValue()->setString(all);
return true;
}
示例2: execute
bool KviKvsTreeNodeAliasSimpleCommand::execute(KviKvsRunTimeContext * c)
{
KviKvsVariantList l;
if(!m_pParams->evaluate(c, &l))
return false;
KviKvsSwitchList swl;
if(m_pSwitches)
{
if(!(m_pSwitches->evaluate(c, &swl)))
return false;
}
const KviKvsScript * s = KviKvsAliasManager::instance()->lookup(m_szCmdName);
if(!s)
{
if(KVI_OPTION_BOOL(KviOption_boolSendUnknownCommandsAsRaw))
{
QString szAll;
l.allAsString(szAll);
if(!szAll.isEmpty())
szAll.prepend(" ");
szAll.prepend(m_szCmdName);
QByteArray szData;
if(!c->window()->context())
goto no_way_to_send_as_raw;
if(!c->window()->connection())
goto no_way_to_send_as_raw;
szData = c->window()->connection()->encodeText(szAll);
if(!szData.data())
szData = "";
if(!c->window()->connection()->sendData(szData.data()))
goto no_way_to_send_as_raw;
c->window()->output(KVI_OUT_RAW, __tr2qs_ctx("[RAW]: %Q", "kvs"), &szAll);
return true;
no_way_to_send_as_raw:
c->warning(this, __tr2qs_ctx("Failed to send an unknown command as /RAW", "kvs"));
c->error(this, __tr2qs_ctx("Call to undefined command '%Q'", "kvs"), &m_szCmdName);
return false;
}
else
{
c->error(this, __tr2qs_ctx("Call to undefined command '%Q'", "kvs"), &m_szCmdName);
return false;
}
}
KviKvsScript copy(*s); // quick reference
// FIXME: the ExtRTData could be a member structure
// it would avoid the constructor call each time
KviKvsExtendedRunTimeData extData(&swl);
if(!copy.run(c->window(), &l, nullptr, KviKvsScript::PreserveParams, &extData))
{
c->error(this, __tr2qs_ctx("Error in inner alias command call '%Q', called from this context", "kvs"), &m_szCmdName);
return false;
}
return true;
}