本文整理汇总了C++中StringVar::Set方法的典型用法代码示例。如果您正苦于以下问题:C++ StringVar::Set方法的具体用法?C++ StringVar::Set怎么用?C++ StringVar::Set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringVar
的用法示例。
在下文中一共展示了StringVar::Set方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
StringIterLoop::StringIterLoop(const ForEachContext* context)
{
StringVar* srcVar = g_StringMap.Get(context->sourceID);
StringVar* iterVar = g_StringMap.Get(context->iteratorID);
if (srcVar && iterVar)
{
m_src = srcVar->String();
m_curIndex = 0;
m_iterID = context->iteratorID;
if (m_src.length())
iterVar->Set(m_src.substr(0, 1).c_str());
}
}
示例2: Cmd_sv_Set_Execute
bool Cmd_sv_Set_Execute(COMMAND_ARGS)
{
char buffer[kMaxMessageLength] = { 0 };
UInt32 stringID = 0;
if (ExtractFormatStringArgs(0, buffer, PASS_FMTSTR_ARGS, kCommandInfo_sv_Set.numParams, &stringID))
{
StringVar* var = g_StringMap.Get(stringID);
if (var)
{
var->Set(buffer);
}
}
return true;
}
示例3: Update
bool StringIterLoop::Update(COMMAND_ARGS)
{
StringVar* iterVar = g_StringMap.Get(m_iterID);
if (iterVar)
{
m_curIndex++;
if (m_curIndex < m_src.length())
{
iterVar->Set(m_src.substr(m_curIndex, 1).c_str());
return true;
}
}
return false;
}
示例4: AssignToStringVarLong
bool AssignToStringVarLong(COMMAND_ARGS, const char* newValue)
{
double strID = 0;
UInt8 modIndex = 0;
bool bTemp = ExpressionEvaluator::Active();
StringVar* strVar = NULL;
UInt32 len = (newValue) ? strlen(newValue) : 0;
if (!newValue || len >= kMaxMessageLength) //if null pointer or too long, assign an empty string
newValue = "";
if (ExtractSetStatementVar(scriptObj, eventList, scriptData, &strID, &modIndex)) {
strVar = g_StringMap.Get(strID);
bTemp = false;
}
else if (!bTemp) {
_WARNING("Function must be used within a Set statement or NVSE expression");
return false;
}
if (!modIndex)
modIndex = scriptObj->GetModIndex();
if (strVar)
{
strVar->Set(newValue);
g_StringMap.MarkTemporary(strID, false);
}
else
strID = g_StringMap.Add(modIndex, newValue, bTemp);
*result = strID;
#if _DEBUG // console feedback disabled in release by request (annoying when called from batch scripts)
if (IsConsoleMode() && !bTemp)
{
if (len < 480)
Console_Print("Assigned string >> \"%s\"", newValue);
else
Console_Print("Assigned string (too long to print)");
}
#endif
return true;
}
示例5: SetString
void SetString(UInt32 stringID, const char* newVal)
{
StringVar* var = g_StringMap.Get(stringID);
if (var)
var->Set(newVal);
}