当前位置: 首页>>代码示例>>C++>>正文


C++ JPtrArray类代码示例

本文整理汇总了C++中JPtrArray的典型用法代码示例。如果您正苦于以下问题:C++ JPtrArray类的具体用法?C++ JPtrArray怎么用?C++ JPtrArray使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了JPtrArray类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: itsTable

SyGDuplicateProcess::SyGDuplicateProcess
	(
	SyGFileTreeTable*					table,
	const JPtrArray<SyGFileTreeNode>&	nodeList
	)
	:
	itsTable(table),
	itsNodeList(JPtrArrayT::kForgetAll),
	itsFullNameList(JPtrArrayT::kDeleteAll),
	itsProcess(NULL),
	itsShouldEditFlag(JI2B(nodeList.GetElementCount() == 1))
{
	(itsTable->GetTableSelection()).ClearSelection();
	ClearWhenGoingAway(itsTable, &itsTable);

	const JSize count = nodeList.GetElementCount();
	for (JIndex i=1; i<=count; i++)
		{
		SyGFileTreeNode* node = const_cast<SyGFileTreeNode*>(nodeList.NthElement(i));
		itsNodeList.Append(node);
		itsFullNameList.Append((node->GetDirEntry())->GetFullName());
		ListenTo(node);
		}

	ProcessNextFile();
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:26,代码来源:SyGDuplicateProcess.cpp

示例2: cell

void
JXTreeListWidget::SelectNodes
	(
	const JPtrArray<JTreeNode>& list
	)
{
	JTableSelection& s = GetTableSelection();

	const JSize count = list.GetElementCount();
	for (JIndex i=1; i<=count; i++)
		{
		const JTreeNode* node = list.NthElement(i);
		JIndex index;
		if (itsTreeList->FindNode(node, &index))
			{
			const JPoint cell(itsNodeColIndex, index);
			s.SelectCell(cell);

			if (!s.HasAnchor())
				{
				s.SetAnchor(cell);
				}
			s.SetBoat(cell);
			}
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:26,代码来源:JXTreeListWidget.cpp

示例3: JExecute

JError
JExecute
	(
	const JPtrArray<JString>&	argList,
	pid_t*						childPID,
	const JExecuteAction		toAction,
	int*						toFD,
	const JExecuteAction		fromAction,
	int*						fromFD,
	const JExecuteAction		errAction,
	int*						errFD
	)
{
	const JSize argc = argList.GetElementCount();

	const JCharacter** argv = new const JCharacter* [ argc+1 ];
	assert( argv != NULL );

	for (JIndex i=1; i<=argc; i++)
		{
		argv[i-1] = *(argList.NthElement(i));
		}
	argv[argc] = NULL;

	const JError err = JExecute(argv, (argc+1) * sizeof(JCharacter*), childPID,
								toAction, toFD, fromAction, fromFD,
								errAction, errFD);

	delete [] argv;
	return err;
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:31,代码来源:jProcessUtil.cpp

示例4: assert

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;
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:60,代码来源:CBCommand.cpp

示例5:

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);
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:32,代码来源:JWebBrowser.cpp

示例6: dataStream

void
GPrefsMgr::GetInboxes
	(
	JPtrArray<JString>& inboxes
	)
{
	if (IDValid(kGInboxesID))
		{
		std::string data;
		const JBoolean ok = GetData(kGInboxesID, &data);
		assert( ok );

		std::istringstream dataStream(data);

		JSize count;
		dataStream >> count;

		inboxes.SetCompareFunction(CompareFileNames);

		for (JIndex i=1; i<=count; i++)
			{
			JString* str = new JString;
			assert( str != NULL );
			dataStream >> *str;
			if (!inboxes.InsertSorted(str, kJFalse))
				{
				delete str;
				}
			}
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:31,代码来源:GPrefsMgr.cpp

示例7: JPrepArgForExec

void
SyGViewManPageDialog::ViewManPages
	(
	const JPtrArray<JString>& list
	)
{
	if (itsViewCmd == kDefaultViewCmd)
		{
		JString cmd = kDefaultViewBin;

		const JSize count = list.GetElementCount();
		for (JIndex i=1; i<=count; i++)
			{
			cmd += kDefaultViewArg;
			cmd += JPrepArgForExec(*(list.NthElement(i)));
			}

		JSimpleProcess::Create(cmd, kJTrue);
		}
	else
		{
		const JSize count = list.GetElementCount();
		for (JIndex i=1; i<=count; i++)
			{
			ViewManPage(*(list.NthElement(i)));
			}
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:28,代码来源:SyGViewManPageDialog.cpp

示例8:

void
CBStringCompleter::CopySymbolsForLanguage
	(
	const CBLanguage lang
	)
{
	JPtrArray<CBProjectDocument>* docList =
		(CBGetDocumentManager())->GetProjectDocList();

	const JSize docCount = docList->GetElementCount();
	for (JIndex i=1; i<=docCount; i++)
		{
		const CBSymbolList* symbolList =
			((docList->NthElement(i))->GetSymbolDirector())->GetSymbolList();

		const JSize symbolCount = symbolList->GetElementCount();
		for (JIndex j=1; j<=symbolCount; j++)
			{
			CBLanguage l;
			CBSymbolList::Type type;
			JBoolean fullyQualifiedFileScope;
			const JString& symbolName =
				symbolList->GetSymbol(j, &l, &type, &fullyQualifiedFileScope);
			if (l == lang && !fullyQualifiedFileScope)
				{
				Add(const_cast<JString*>(&symbolName));
				}
			}
		}
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:30,代码来源:CBStringCompleter.cpp

示例9: newInfo

void
CBApp::CollectSearchPaths
	(
	CBDirInfoList* searchPaths
	)
	const
{
	searchPaths->DeleteAll();
	searchPaths->SetCompareFunction(CBDirInfo::ComparePathNames);

	JPtrArray<CBProjectDocument>* docList =
		(CBGetDocumentManager())->GetProjectDocList();

	const JSize docCount = docList->GetElementCount();
	JString truePath;
	JBoolean recurse;
	for (JIndex j=1; j<=docCount; j++)
		{
		CBProjectDocument* doc   = docList->NthElement(j);
		const CBDirList& dirList = doc->GetDirectories();
		const JSize count        = dirList.GetElementCount();
		for (JIndex i=1; i<=count; i++)
			{
			if (dirList.GetTruePath(i, &truePath, &recurse))
				{
				CBDirInfo newInfo(jnew JString(truePath), recurse);
				assert( newInfo.path != NULL );
				newInfo.projIndex = j;

				JBoolean found;
				const JIndex index =
					searchPaths->SearchSorted1(newInfo, JOrderedSetT::kAnyMatch, &found);
				if (found)
					{
					// compute OR of recurse flags

					CBDirInfo existingInfo = searchPaths->GetElement(index);
					if (newInfo.recurse && !existingInfo.recurse)
						{
						existingInfo.recurse = kJTrue;
						searchPaths->SetElement(index, existingInfo);
						}
					jdelete newInfo.path;
					}
				else
					{
					searchPaths->InsertElementAtIndex(index, newInfo);
					}
				}
			}
		}

	searchPaths->SetCompareFunction(CBDirInfo::CompareProjIndex);
	searchPaths->Sort();
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:55,代码来源:CBApp.cpp

示例10: itsLanguage

CBStringCompleter::CBStringCompleter
	(
	const CBLanguage	lang,
	const JSize			keywordCount,
	const JCharacter**	keywordList,
	const JBoolean		caseSensitive
	)
	:
	itsLanguage(lang),
	itsPredefKeywordCount(keywordCount),
	itsPrefefKeywordList(keywordList),
	itsCaseSensitiveFlag(caseSensitive)
{
	itsStringList = new JPtrArray<JString>(JPtrArrayT::kForgetAll, 1000);
	assert( itsStringList != NULL );
	itsStringList->SetSortOrder(JOrderedSetT::kSortAscending);

	if (itsCaseSensitiveFlag)
		{
		itsStringList->SetCompareFunction(JCompareStringsCaseSensitive);
		}
	else
		{
		itsStringList->SetCompareFunction(JCompareStringsCaseInsensitive);
		}

	itsOwnedList = new JPtrArray<JString>(JPtrArrayT::kDeleteAll);
	assert( itsOwnedList != NULL );

	if (itsLanguage != kCBOtherLang)
		{
		ListenTo(CBGetDocumentManager());
		}

	CBGetStyler(lang, &itsStyler);
	UpdateWordList();
	if (itsStyler != NULL)
		{
		ListenTo(itsStyler);
		}

	// We are constructed at a random point in time, so we have to
	// ListenTo() all pre-existing project documents.

	JPtrArray<CBProjectDocument>* docList =
		(CBGetDocumentManager())->GetProjectDocList();

	const JSize docCount = docList->GetElementCount();
	for (JIndex i=1; i<=docCount; i++)
		{
		ListenTo(((docList->NthElement(i))->GetSymbolDirector())->GetSymbolList());
		}
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:53,代码来源:CBStringCompleter.cpp

示例11:

void
JXApplication::PopIdleTaskStack()
{
	if (!itsIdleTaskStack->IsEmpty())
		{
		JPtrArray<JXIdleTask>* list = itsIdleTasks;
		itsIdleTasks                = itsIdleTaskStack->LastElement();
		itsIdleTaskStack->RemoveElement(itsIdleTaskStack->GetElementCount());

		itsIdleTasks->CopyPointers(*list, JPtrArrayT::kDeleteAll, kJTrue);
		list->SetCleanUpAction(JPtrArrayT::kForgetAll);
		delete list;
		}
}
开发者ID:,项目名称:,代码行数:14,代码来源:

示例12:

void
GenerateHeader
	(
	ostream&					output,
	const JPtrArray<JString>&	objTypes,
	const JPtrArray<JString>&	objNames
	)
{
	JIndex i;
	const JSize count = objTypes.GetElementCount();
	assert( count == objNames.GetElementCount() );

	// get width of longest type

	JSize maxLen = 0;
	for (i=1; i<=count; i++)
		{
		const JString* type = objTypes.NthElement(i);
		const JSize len     = type->GetLength();
		if (len > maxLen)
			{
			maxLen = len;
			}
		}

	// declare each object

	for (i=1; i<=count; i++)
		{
		output << "    ";
		const JString* type = objTypes.NthElement(i);
		type->Print(output);
		output << '*';
		const JSize len = type->GetLength();
		for (JIndex j=len+1; j<=maxLen+1; j++)
			{
			output << ' ';
			}
		(objNames.NthElement(i))->Print(output);
		output << ';' << endl;
		}

	// need blank line to conform to expectations of CopyAfterCodeDelimiter

	output << endl;
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:46,代码来源:jxlayout.cpp

示例13:

void
GPrefsMgr::SetUIDList
	(
	const JPtrArray<JString>& list
	)
{
	const JSize count = list.GetElementCount();

	std::ostringstream data;
	data << count;

	for (JIndex i=1; i<=count; i++)
		{
		data << ' ' << *(list.NthElement(i));
		}

	SetData(kGUIDListID, data);
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:18,代码来源:GPrefsMgr.cpp

示例14: while

void
JXDocktab::UpdateActionMenu()
{
	JXDockManager* dockMgr;
	if (!JXGetDockManager(&dockMgr))
		{
		itsActionMenu->RemoveAllItems();
		return;
		}

	while (itsActionMenu->GetItemCount() >= kShowFirstDockCmd)
		{
		itsActionMenu->RemoveItem(itsActionMenu->GetItemCount());
		}

	JPtrArray<JXDockDirector>* dockList = dockMgr->GetDockList();

	const JSize dockCount = dockList->GetElementCount();
	for (JIndex i=1; i<=dockCount; i++)
		{
		JString itemText = ((dockList->NthElement(i))->GetWindow())->GetTitle();
		itemText.Prepend(JGetString(kShowDockPrefixID));
		itsActionMenu->AppendItem(itemText);
		}

	const JBoolean isDocked = (GetWindow())->IsDocked();
	itsActionMenu->SetItemEnable(kUndockCmd, isDocked);
	itsActionMenu->SetItemEnable(kUndockAllCompartmentCmd, isDocked);
	itsActionMenu->SetItemEnable(kUndockAllDockCmd, isDocked);
	itsActionMenu->SetItemEnable(kUndockAllCmd, JI2B(dockCount > 0));
	itsActionMenu->SetItemEnable(kDockAllDefConfigCmd, dockMgr->CanDockAll());

	itsActionMenu->SetItemEnable(kUpdateWindowTypeMapCmd, (GetWindow())->HasWindowType());
	if (isDocked)
		{
		itsActionMenu->SetItemText(kUpdateWindowTypeMapCmd, JGetString(kAddToWindowTypeMapID));
		}
	else
		{
		itsActionMenu->SetItemText(kUpdateWindowTypeMapCmd, JGetString(kRemoveFromWindowTypeMapID));
		}
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:42,代码来源:JXDocktab.cpp

示例15: CBGetDocumentManager

void
CBEditProjPrefsDialog::UpdateSettings()
{
	(CBGetApplication())->DisplayBusyCursor();

	const JBoolean reopenTextFiles      = itsReopenTextFilesCB->IsChecked();
	const JBoolean doubleSpaceCompile   = itsDoubleSpaceCB->IsChecked();
	const JBoolean rebuildMakefileDaily = itsRebuildMakefileDailyCB->IsChecked();

	const CBProjectTable::DropFileAction dropFileAction =
		(CBProjectTable::DropFileAction) itsDropFileActionRG->GetSelectedItem();

	CBDocumentManager* docMgr             = CBGetDocumentManager();
	JPtrArray<CBProjectDocument>* docList = docMgr->GetProjectDocList();
	const JSize docCount = docList->GetElementCount();

	for (JIndex i=1; i<=docCount; i++)
		{
		(docList->NthElement(i))->
			SetProjectPrefs(reopenTextFiles, doubleSpaceCompile,
							rebuildMakefileDaily, dropFileAction);
		}
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:23,代码来源:CBEditProjPrefsDialog.cpp


注:本文中的JPtrArray类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。