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


C++ JArray::GetElementCount方法代码示例

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


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

示例1: DecodeMIMEWord

void
GMessageHeader::DecodeMIMEHeader
	(
	JString* header
	)
{
	JArray<JIndexRange> subList;
	JSize count	= encodedMIMEQRegex.MatchAll(*header, &subList);
	JBoolean qType	= kJTrue;
	if (count == 0)
		{
		count	= encodedMIMEBRegex.MatchAll(*header, &subList);
		qType	= kJFalse;
		}
	if (count > 0)
		{
		JString temp;
		JIndex mIndex		= 1;
		const JSize count	= subList.GetElementCount();
		for (JIndex i = 1; i <= count; i++)
			{
			JIndexRange range	= subList.GetElement(i);
//			if ((range.first != mIndex) &&
//				RangeContainsNWS(*header, mIndex, range.first))
//				{
//				temp += header->GetSubstring(mIndex, range.first - 1);
//				}
			if (range.first != mIndex)
				{
				JString trimmed = header->GetSubstring(mIndex, range.first - 1);
				trimmed.TrimWhitespace();
				if (!trimmed.IsEmpty())
					{
					temp += header->GetSubstring(mIndex, range.first - 1);
					}
				}
			temp   += DecodeMIMEWord(qType, header, range);
			mIndex	= range.last + 1;
			}
		if (mIndex < header->GetLength())
			{
			temp   += header->GetSubstring(mIndex, header->GetLength());
			}
		*header = temp;
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:46,代码来源:GMessageHeader.cpp

示例2: GetDataColCount

void
GRaggedFloatTableData::SetRow
	(
	const JIndex				index,
	const JArray<JFloat>&	rowData
	)
{
	const JSize colCount = GetDataColCount();
	assert( rowData.GetElementCount() == colCount );

	for (JIndex i=1; i<=colCount; i++)
		{
		JArray<JFloat>* dataCol = itsCols->NthElement(i);
		dataCol->SetElement(index, rowData.GetElement(i));
		}

	Broadcast(JTableData::RectChanged(JRect(index, 1, index+1, colCount+1)));
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:18,代码来源:GRaggedFloatTableData.cpp

示例3: GetDisplay

void
TestWidget::PrintSelectionTargets
	(
	const Time time
	)
{
	JXDisplay* display         = GetDisplay();
	JXSelectionManager* selMgr = GetSelectionManager();
	JXDNDManager* dndMgr       = GetDNDManager();

	JArray<Atom> typeList;
	if (selMgr->GetAvailableTypes(kJXClipboardName, time, &typeList))
		{
		std::cout << std::endl;
		std::cout << "Data types available from the clipboard:" << std::endl;
		std::cout << std::endl;

		const JSize typeCount = typeList.GetElementCount();
		for (JIndex i=1; i<=typeCount; i++)
			{
			const Atom type = typeList.GetElement(i);
			std::cout << XGetAtomName(*display, type) << std::endl;
			}

		for (JIndex i=1; i<=typeCount; i++)
			{
			const Atom type = typeList.GetElement(i);
			if (type == XA_STRING ||
				type == selMgr->GetUtf8StringXAtom() ||
				type == selMgr->GetMimePlainTextXAtom())
				{
				std::cout << std::endl;
				PrintSelectionText(kJXClipboardName, time, type);
				}
			}
		}
	else
		{
		std::cout << std::endl;
		std::cout << "Unable to access the clipboard." << std::endl;
		std::cout << std::endl;
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:43,代码来源:TestWidget.cpp

示例4: JString

JX2DCurveOptionsDialog::JX2DCurveOptionsDialog
	(
	JXWindowDirector*			supervisor,
	const JArray<J2DCurveInfo>&	array,
	const JArray<JBoolean>&		hasXErrors,
	const JArray<JBoolean>&		hasYErrors,
	const JArray<JBoolean>&		isFunction,
	const JArray<JBoolean>&		isScatter,
	const JIndex				startIndex
	)
	:
	JXDialogDirector(supervisor, kJTrue),
	itsCurrentIndex(startIndex)
{
	assert( array.IndexValid(startIndex) );

	itsCurveInfo = new JArray<J2DCurveInfo>;
	assert(itsCurveInfo != NULL);

	const JSize count = array.GetElementCount();
	for (JIndex i=1; i<=count; i++)
		{
		J2DCurveInfo info = array.GetElement(i);
		info.name = new JString(*info.name);
		assert(info.name != NULL);
		itsCurveInfo->AppendElement(info);
		}

	itsHasXErrors = new JArray<JBoolean>(hasXErrors);
	assert( itsHasXErrors != NULL );

	itsHasYErrors = new JArray<JBoolean>(hasYErrors);
	assert( itsHasYErrors != NULL );

	itsIsFunction = new JArray<JBoolean>(isFunction);
	assert( itsIsFunction != NULL );

	itsIsScatter = new JArray<JBoolean>(isScatter);
	assert( itsIsScatter != NULL );

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

示例5: GetDisplay

void
TestWidget::PrintSelectionTargets
	(
	const Time time
	)
{
	JXDisplay* display         = GetDisplay();
	JXSelectionManager* selMgr = GetSelectionManager();
	JXDNDManager* dndMgr       = GetDNDManager();

	JArray<Atom> typeList;
	if (selMgr->GetAvailableTypes(kJXClipboardName, time, &typeList))
		{
		cout << endl;
		cout << "Data types available from the clipboard:" << endl;
		cout << endl;

		Atom textType = None;
		const JSize typeCount = typeList.GetElementCount();
		for (JIndex i=1; i<=typeCount; i++)
			{
			const Atom type = typeList.GetElement(i);
			cout << XGetAtomName(*display, type) << endl;
			if (type == XA_STRING)
				{
				textType = type;
				}
			}
		cout << endl;

		if (textType != None)
			{
			PrintSelectionText(kJXClipboardName, time, textType);
			}
		}
	else
		{
		cout << endl;
		cout << "Unable to access the clipboard." << endl;
		cout << endl;
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:42,代码来源:TestWidget.cpp

示例6:

JBoolean
CBStylerBase::TypeStylesChanged
	(
	const JArray<JFontStyle>& newTypeStyles
	)
	const
{
	const JSize count = itsTypeStyles->GetElementCount();
	assert( newTypeStyles.GetElementCount() == count );

	for (JIndex i=1; i<=count; i++)
		{
		if (itsTypeStyles->GetElement(i) != newTypeStyles.GetElement(i))
			{
			return kJTrue;
			}
		}

	return kJFalse;
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:20,代码来源:CBStylerBase.cpp

示例7: GetRowCount

void
GRaggedFloatTableData::RemoveRow
	(
	const JIndex index
	)
{
	assert( index < GetRowCount() );

	const JSize colCount = itsCols->GetElementCount();
	for (JIndex i=1; i<=colCount; i++)
		{
		JArray<JFloat>* colData = itsCols->NthElement(i);
		const JSize rowCount = colData->GetElementCount();

		if (index <= rowCount)
			{
			RemoveElement(index, i);
			}
		}

}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:21,代码来源:GRaggedFloatTableData.cpp

示例8:

void
JXGC::SetDashList
	(
	const JArray<JSize>&	dashList,
	const JSize				offset
	)
{
	const JSize dashCount = dashList.GetElementCount();

	char* xDashList = new char [ dashCount ];
	assert( xDashList != NULL );

	for (JIndex i=1; i<=dashCount; i++)
		{
		xDashList[i-1] = dashList.GetElement(i);
		}

	XSetDashes(*itsDisplay, itsXGC, offset, xDashList, dashCount);

	delete [] xDashList;
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:21,代码来源:JXGC.cpp

示例9:

void
GRaggedFloatTableData::MoveRow
	(
	const JIndex origIndex,
	const JIndex newIndex
	)
{
	const JSize colCount = itsCols->GetElementCount();
	for (JIndex i=1; i<=colCount; i++)
		{
		JArray<JFloat>* colData = itsCols->NthElement(i);
		const JSize rowCount = colData->GetElementCount();
		if ( (origIndex <= rowCount) && (newIndex <= rowCount) )
			{
			colData->MoveElementToIndex(origIndex, newIndex);
			}
		}

	if (itsBroadcast)
		{
		Broadcast(JTableData::RowMoved(origIndex, newIndex));
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:23,代码来源:GRaggedFloatTableData.cpp

示例10: JGetString

JBoolean
CBSymbolList::UpdateFinished
	(
	const JArray<JFAID_t>&	deadFileList,
	JProgressDisplay&		pg
	)
{
	DeleteProcess();

	// reset to lenient search

	itsSymbolList->SetCompareFunction(CompareSymbols);

	// toss files that no longer exist

	const JSize fileCount = deadFileList.GetElementCount();
	if (fileCount > 0)
		{
		pg.FixedLengthProcessBeginning(fileCount, JGetString(kCleaningUpID), kJFalse, kJTrue);

		for (JIndex i=1; i<=fileCount; i++)
			{
			RemoveFile(deadFileList.GetElement(i));
			pg.IncrementProgress();
			}

		pg.ProcessFinished();
		}

	if (itsChangedDuringParseFlag && !CBInUpdateThread())
		{
		itsReparseAllFlag = kJFalse;
		Broadcast(Changed());
		}

	return itsChangedDuringParseFlag;
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:37,代码来源:CBSymbolList.cpp

示例11: if

JParseResult
JParseAsSummation
	(
	const JCharacter*		origExpr,
	const JSize				origLength,
	const JVariableList*	theVariableList,
	JFunction**				theFunction,
	const JBoolean			allowUIF
	)
{
	*theFunction = NULL;

	// remove enclosing parentheses

	const JCharacter* expr = origExpr;
	const JSize length     = JStripParentheses(&expr, origLength);

	// build a list of the locations of all visible + and - operators

	const JCharacter* plusStr  = JPGetAdditionString();
	const JSize plusLength     = JPGetAdditionStringLength();
	const JCharacter* minusStr = JPGetSubtractionString();
	const JSize minusLength    = JPGetSubtractionStringLength();

	JArray<JCharacter> opList;
	JArray<JSize> opOffsetList;
	JArray<JSize> argOffsetList;
	JSize lastOffset = 0;
	while (1)
		{
		JSize plusOffset;
		const JBoolean foundPlus =
			JFindFirstOperator(expr + lastOffset, length - lastOffset,
							   plusStr, &plusOffset);
		plusOffset += lastOffset;

		JSize minusOffset;
		const JBoolean foundMinus =
			JFindFirstOperator(expr + lastOffset, length - lastOffset,
							   minusStr, &minusOffset);
		minusOffset += lastOffset;

		JCharacter opType;
		JSize opOffset, argOffset;
		if (foundPlus && foundMinus && plusOffset < minusOffset)
			{
			opType = '+';
			opOffset  = plusOffset;
			argOffset = plusOffset + plusLength;
			}
		else if (foundPlus && foundMinus && minusOffset < plusOffset)
			{
			opType = '-';
			opOffset  = minusOffset;
			argOffset = minusOffset + minusLength;
			}
		else if (foundPlus)
			{
			opType = '+';
			opOffset  = plusOffset;
			argOffset = plusOffset + plusLength;
			}
		else if (foundMinus)
			{
			opType = '-';
			opOffset  = minusOffset;
			argOffset = minusOffset + minusLength;
			}
		else
			{
			break;
			}

		if (!JIsExponentSign(expr, opOffset, argOffset))
			{
			opList.AppendElement(opType);
			opOffsetList.AppendElement(opOffset);
			argOffsetList.AppendElement(argOffset);
			}

		lastOffset = argOffset;
		}

	if (opList.IsEmpty())
		{
		return kJNotMyProblem;
		}
	else if (opList.GetElementCount() == 1 && opOffsetList.GetElement(1) == 0)
		{
		const JSize argOffset = argOffsetList.GetElement(1);
		JFunction* arg = NULL;
		if (!JRecurseFunction(expr + argOffset, length - argOffset, theVariableList,
							  &arg, allowUIF))
			{
			return kJParseError;
			}

		if (opList.GetElement(1) == '-')
			{
			*theFunction = new JNegation(arg);
//.........这里部分代码省略.........
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:101,代码来源:jParseFunction.cpp

示例12: if

JBoolean
TestWidget::WillAcceptDrop
	(
	const JArray<Atom>&	typeList,
	Atom*				action,
	const JPoint&		pt,
	const Time			time,
	const JXWidget*		source
	)
{
	JXDNDManager* dndMgr = GetDNDManager();
	JXDisplay* display   = GetDisplay();

	JBoolean hasURIList = kJFalse;

	std::cout << std::endl;
	std::cout << "Data types available from DND source:" << std::endl;
	std::cout << std::endl;

	const JSize typeCount = typeList.GetElementCount();
	for (JIndex i=1; i<=typeCount; i++)
		{
		const Atom type = typeList.GetElement(i);
		std::cout << XGetAtomName(*display, type) << std::endl;

		if (type == GetSelectionManager()->GetURLXAtom())
			{
			hasURIList = kJTrue;
			}
		}

	if (hasURIList)
		{
		if (its2Rect.Contains(pt) || its3Rect.Contains(pt))
			{
			std::cout << std::endl;
			std::cout << "Accepting the drop of type text/uri-list" << std::endl;
			std::cout << std::endl;

			*action = dndMgr->GetDNDActionPrivateXAtom();
			return kJTrue;
			}
		else
			{
			return kJFalse;
			}
		}
	else if (*action == dndMgr->GetDNDActionCopyXAtom())
		{
		std::cout << std::endl;
		std::cout << "Accepting the drop" << std::endl;
		std::cout << std::endl;

		PrintSelectionText(dndMgr->GetDNDSelectionName(), time,
						   GetSelectionManager()->GetMimePlainTextXAtom());
		return kJTrue;
		}
	else
		{
		std::cout << std::endl;
		std::cout << "Not accepting the drop because the action isn't copy" << std::endl;
		std::cout << "Action: " << XGetAtomName(*display, *action) << std::endl;
		std::cout << std::endl;

		PrintSelectionText(dndMgr->GetDNDSelectionName(), time,
						   GetSelectionManager()->GetMimePlainTextXAtom());

		return kJFalse;
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:70,代码来源:TestWidget.cpp

示例13: if

void
GMMIMEParser::ParseMIMEHeader
	(
	std::istream&		input,
	GMIMEHeader*	header,
	const JBoolean	display
	)
{
	JString data;
	JCharacter c	= input.peek();
	if (c == '\n')
		{
//		input.get(c);
		}
//	input >> std::ws;

	// first we need to search for the first empty line. This line is the
	// end of the header.

	JString line;
	while (1)
		{
		JBoolean found;
		line = JReadLine(input, &found);
		if (line.IsEmpty())
			{
			break;
			}
		if (isspace(line.GetFirstCharacter()))
			{
			line.TrimWhitespace();
			if (line.IsEmpty())
				{
				break;
				}
			data.AppendCharacter(' ');
			}
		else if (!data.IsEmpty())
			{
			data.AppendCharacter('\n');
			}
		data += line;
		}
	data.AppendCharacter('\n');

	// we now need to search through the header for parameter:value pairs
	// using the gmime_header_regex defined above.

	JArray<JIndexRange> ranges;
	gmime_header_regex.MatchAll(data, &ranges);

	JSize count = ranges.GetElementCount();
	for (JSize i = 1; i <= count; i++)
		{
		JIndexRange range = ranges.GetElement(i);
		JString parmValPair = data.GetSubstring(range);
		JString parm;
		JString val;
		if (parmValPair.BeginsWith("MIME") ||
			parmValPair.BeginsWith("Mime") ||
			parmValPair.BeginsWith("Content"))
			{
			CleanParmValPair(parmValPair, &parm, &val);
			parm.ToLower();
			if (parm == "mime-Version")
				{
				val.TrimWhitespace();
				header->SetVersion(val);
				}
			else if (parm == "content-type")
				{
				ParseContentType(val, header);
				}
			else if (parm == "content-transfer-encoding")
				{
				val.TrimWhitespace();
				val.ToLower();
				header->SetEncoding(val);
				}
			else if (parm == "content-disposition")
				{
				ParseContentDisposition(val, header);
				}
			}
		}

	// this is a nested message, so some of the headers need to be displayed
	if (display)
		{
		JString text = "---------\n";
		JIndex findex	= 1;
		if (data.BeginsWith("From: ") || data.LocateSubstring("\nFrom: ", &findex))
			{
			if (findex > 1)
				{
				findex ++;
				}
			JIndex eindex	= findex;
			if (data.LocateNextSubstring("\n", &eindex) && (eindex > findex + 1))
				{
//.........这里部分代码省略.........
开发者ID:jafl,项目名称:jx_application_framework,代码行数:101,代码来源:GMMIMEParser.cpp

示例14: if

JBoolean
CBCtagsUser::HasExuberantCtags()
{
	if (itsHasExuberantCtagsFlag == kUntested)
		{
		itsHasExuberantCtagsFlag = kFailure;

		// this hack is required on Linux kernel 2.3.x (4/19/2000)
		j_sig_func*	origHandler = signal(SIGCHLD, emptyHandler);

		pid_t pid;

		#if defined _J_SUNOS
		pid_t* ppid = NULL;
		#else
		pid_t* ppid = &pid;
		#endif

		int fromFD;
		JError err = JExecute(kCheckVersionCmd, ppid,
							  kJIgnoreConnection, NULL,
							  kJCreatePipe, &fromFD,
							  kJTossOutput, NULL);
		if (err.OK())
			{
			JString vers;
			JReadAll(fromFD, &vers);

			JArray<JIndexRange> matchList;
			if (versionPattern.Match(vers, &matchList))
				{
				matchList.RemoveElement(1);

				const JSize count = matchList.GetElementCount();
				JString s;
				for (JIndex i=1; i<=count; i++)
					{
					JUInt v = 0;
					const JIndexRange r = matchList.GetElement(i);
					if (!r.IsEmpty())
						{
						s = vers.GetSubstring(r);
						while (!isdigit(s.GetFirstCharacter()))
							{
							s.RemoveSubstring(1, 1);
							}
						const JBoolean ok = s.ConvertToUInt(&v);
						assert( ok );
						}

					if (v > kMinVersion[i-1] ||
						(i == count && v == kMinVersion[i-1]))
						{
						itsHasExuberantCtagsFlag = kSuccess;
						break;
						}
					else if (v < kMinVersion[i-1])
						{
						break;
						}
					}
				}
			}

		if (origHandler != SIG_ERR)
			{
			signal(SIGCHLD, origHandler);
			}
		}

	return JI2B( itsHasExuberantCtagsFlag == kSuccess );
}
开发者ID:Lori-Pantera,项目名称:jx_application_framework,代码行数:72,代码来源:CBCtagsUser.cpp

示例15: if

void
JPartition::AdjustCompartmentsAfterDragAll
	(
	const JCoordinate coord
	)
{
JIndex i;

	// compress compartments in front of itsDragIndex+1

	if (coord < itsStartCoord)
		{
		JArray<JCoordinate> origSizes = *itsSizes;
		JArray<JCoordinate> minSizes  = *itsMinSizes;
		JSize count = origSizes.GetElementCount();
		for (i=count; i>itsDragIndex; i--)
			{
			origSizes.RemoveElement(i);
			minSizes.RemoveElement(i);
			}

		JArray<JCoordinate> newSizes;
		const JCoordinate reqSize = itsStartCoord - coord;
		JCoordinate newSpace;
		const JBoolean ok = CreateSpace(origSizes, minSizes, 0, reqSize, reqSize,
										&newSizes, &newSpace);
		assert( ok );

		for (i=1; i<=itsDragIndex; i++)
			{
			itsSizes->SetElement(i, newSizes.GetElement(i));
			}
		itsSizes->SetElement(itsDragIndex+1,
							 itsSizes->GetElement(itsDragIndex+1) + reqSize);

		SetCompartmentSizes();
		}

	// compress compartments after itsDragIndex

	else if (coord > itsStartCoord)
		{
		const JSize compartmentCount = GetCompartmentCount();

		JArray<JCoordinate> origSizes = *itsSizes;
		JArray<JCoordinate> minSizes  = *itsMinSizes;
		for (i=1; i<=itsDragIndex; i++)
			{
			origSizes.RemoveElement(1);
			minSizes.RemoveElement(1);
			}

		JArray<JCoordinate> newSizes;
		const JCoordinate reqSize = coord - itsStartCoord;
		JCoordinate newSpace;
		const JBoolean ok = CreateSpace(origSizes, minSizes, 0, reqSize, reqSize,
										&newSizes, &newSpace);
		assert( ok );

		itsSizes->SetElement(itsDragIndex,
							 itsSizes->GetElement(itsDragIndex) + reqSize);
		for (i=itsDragIndex+1; i<=compartmentCount; i++)
			{
			itsSizes->SetElement(i, newSizes.GetElement(i-itsDragIndex));
			}

		SetCompartmentSizes();
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:69,代码来源:JPartition.cpp


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