本文整理汇总了C++中JPtrArray::IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ JPtrArray::IsEmpty方法的具体用法?C++ JPtrArray::IsEmpty怎么用?C++ JPtrArray::IsEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JPtrArray
的用法示例。
在下文中一共展示了JPtrArray::IsEmpty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
JWebBrowser::ShowFileLocations
(
const JPtrArray<JString>& fileList
)
{
if (fileList.IsEmpty())
{
return;
}
const JSize count = fileList.GetElementCount();
if (itsShowFileLocationCmd.Contains("$"))
{
for (JIndex i=1; i<=count; i++)
{
ShowFileLocation(*(fileList.NthElement(i)));
}
}
else
{
JString s = itsShowFileLocationCmd;
for (JIndex i=1; i<=count; i++)
{
s += " '";
s += *(fileList.NthElement(i));
s += "'";
}
JSimpleProcess::Create(s, kJTrue);
}
}
示例2:
JBoolean
ShouldGenerateForm
(
const JString& form,
const JPtrArray<JString>& list
)
{
if (list.IsEmpty())
{
return kJTrue;
}
const JSize count = list.GetElementCount();
for (JIndex i=1; i<=count; i++)
{
if (form == *(list.NthElement(i)))
{
return kJTrue;
}
}
return kJFalse;
}
示例3: Instance
void
JXFSBindingManager::Exec
(
const JPtrArray<JString>& fileList,
const JBoolean ignoreBindings
)
{
if (fileList.IsEmpty())
{
return;
}
JXFSBindingManager* me = Instance();
if (me->itsFileList == NULL)
{
me->itsFileList = new JPtrArray<JFSBinding>(JPtrArrayT::kDeleteAll);
assert( me->itsFileList != NULL );
me->itsFileList->SetCompareFunction(ComparePatterns);
}
const JSize count = fileList.GetElementCount();
for (JIndex i=1; i<=count; i++)
{
const JString* fileName = fileList.NthElement(i);
JFSBinding* f = new JFSBinding(*fileName, "", JFSBinding::kRunPlain, kJTrue, kJFalse);
assert( f != NULL );
if (!me->itsFileList->InsertSorted(f, kJFalse))
{
delete f;
}
}
me->itsIgnoreBindingsFlag = ignoreBindings;
me->ProcessFiles();
}
示例4: CBIsCaseSensitive
JBoolean
CBSymbolList::ConvertToFullNames
(
JArray<JIndex>* noContextList,
JArray<JIndex>* contextList,
const JString& contextNamespace1,
const JString& contextNamespace2,
const CBLanguage contextLang,
const JPtrArray<JString>& cContextNamespaceList,
const JPtrArray<JString>& javaContextNamespaceList
)
const
{
const JBoolean useLangNSContext = !contextNamespace1.IsEmpty();
const JBoolean useCNSContext = !cContextNamespaceList.IsEmpty();
const JBoolean useJavaNSContext = !javaContextNamespaceList.IsEmpty();
// substitute indicies of fully qualified symbols
// and filter based on namespace context
const JSize symCount = itsSymbolList->GetElementCount();
const SymbolInfo* sym = itsSymbolList->GetCArray();
const JSize count = noContextList->GetElementCount();
JString s1, s2;
for (JIndex i=count; i>=1; i--)
{
const JIndex j = noContextList->GetElement(i) - 1;
const SymbolInfo& info = sym[j];
const JBoolean caseSens = CBIsCaseSensitive(info.lang);
s1 = "." + *(info.name);
s2 = ":" + *(info.name);
for (JIndex k=0; k<symCount; k++)
{
if (k != j &&
sym[k].fileID == info.fileID &&
sym[k].lineIndex == info.lineIndex &&
((sym[k].name)->EndsWith(s1, caseSens) ||
(sym[k].name)->EndsWith(s2, caseSens)))
{
if ((info.lang == kCBCLang && useCNSContext &&
!InContext(*(sym[k].name), cContextNamespaceList, kJTrue)) ||
(info.lang == kCBJavaLang && useJavaNSContext &&
!InContext(*(sym[k].name), javaContextNamespaceList, kJTrue)) ||
(info.lang == contextLang && useLangNSContext &&
!(sym[k].name)->BeginsWith(contextNamespace1, caseSens) &&
!(sym[k].name)->Contains(contextNamespace2, caseSens)))
{
contextList->RemoveElement(i);
}
else
{
contextList->SetElement(i, k+1);
}
noContextList->SetElement(i, k+1);
break;
}
}
}
return !contextList->IsEmpty();
}
示例5: if
JError
CBSearchDocument::Create
(
const JPtrArray<JString>& fileList,
const JPtrArray<JString>& nameList,
const JCharacter* searchStr,
const JBoolean onlyListFiles,
const JBoolean listFilesWithoutMatch
)
{
assert( !fileList.IsEmpty() );
assert( fileList.GetElementCount() == nameList.GetElementCount() );
int fd[2];
JError err = JCreatePipe(fd);
if (!err.OK())
{
return err;
}
pid_t pid;
err = JThisProcess::Fork(&pid);
if (!err.OK())
{
return err;
}
// child
else if (pid == 0)
{
close(fd[0]);
// get rid of JXCreatePG, since we must not use X connection
// (binary files may trigger it)
JInitCore();
CBSearchTE te;
JOutPipeStream output(fd[1], kJTrue);
te.SearchFiles(fileList, nameList,
onlyListFiles, listFilesWithoutMatch,
output);
output.close();
exit(0);
}
// parent
else
{
close(fd[1]);
JProcess* process = jnew JProcess(pid);
assert( process != NULL );
const JCharacter* map[] =
{
"s", searchStr
};
const JString windowTitle = JGetString("SearchTitle::CBSearchDocument", map, sizeof(map));
CBSearchDocument* doc =
jnew CBSearchDocument(kJFalse, JI2B(onlyListFiles || listFilesWithoutMatch),
fileList.GetElementCount(),
process, fd[0], windowTitle);
assert( doc != NULL );
doc->Activate();
RecordLink* link;
const JBoolean ok = doc->GetRecordLink(&link);
assert( ok );
CBSearchTE::SetProtocol(link);
}
return JNoError();
}