本文整理汇总了C++中JPtrArray::CopyObjects方法的典型用法代码示例。如果您正苦于以下问题:C++ JPtrArray::CopyObjects方法的具体用法?C++ JPtrArray::CopyObjects怎么用?C++ JPtrArray::CopyObjects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JPtrArray
的用法示例。
在下文中一共展示了JPtrArray::CopyObjects方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CBGetCommandManager
JBoolean
CBCommand::Add
(
const JPtrArray<JString>& cmdArgs,
const JPtrArray<JString>& fullNameList,
const JArray<JIndex>& lineIndexList,
CBFunctionStack* fnStack
)
{
const JString* firstArg = cmdArgs.FirstElement();
if (firstArg->GetFirstCharacter() == '&')
{
assert( fnStack != NULL );
// check for re-used command name
const JCharacter* cmdName = firstArg->GetCString()+1;
const JSize cmdCount = fnStack->GetElementCount();
for (JIndex j=1; j<=cmdCount; j++)
{
if (strcmp(cmdName, fnStack->Peek(j)) == 0)
{
ReportInfiniteLoop(*fnStack, j);
return kJFalse;
}
}
// prepare cmd for execution later
fnStack->Push(cmdName);
CBCommandManager* mgr =
(itsProjDoc != NULL ? itsProjDoc->GetCommandManager() : CBGetCommandManager());
CBCommand* cmdObj;
CBCommandManager::CmdInfo* cmdInfo;
if (mgr->Prepare(cmdName, itsProjDoc, fullNameList, lineIndexList,
&cmdObj, &cmdInfo, fnStack))
{
cmdObj->SetParent(this);
itsCmdList->AppendElement(CmdInfo(NULL, cmdObj, cmdInfo, kJFalse));
}
else
{
return kJFalse;
}
fnStack->Pop();
}
else
{
JPtrArray<JString>* args = jnew JPtrArray<JString>(JPtrArrayT::kDeleteAll);
assert( args != NULL );
args->CopyObjects(cmdArgs, JPtrArrayT::kDeleteAll, kJFalse);
itsCmdList->AppendElement(CmdInfo(args, NULL, NULL, kJFalse));
}
return kJTrue;
}