本文整理汇总了C++中JArray::RemoveElement方法的典型用法代码示例。如果您正苦于以下问题:C++ JArray::RemoveElement方法的具体用法?C++ JArray::RemoveElement怎么用?C++ JArray::RemoveElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JArray
的用法示例。
在下文中一共展示了JArray::RemoveElement方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
GRaggedFloatTableData::RemoveElement
(
const JIndex row,
const JIndex col
)
{
JArray<JFloat>* dataCol = itsCols->NthElement(col);
const JSize rowCount = dataCol->GetElementCount();
if (row <= rowCount)
{
dataCol->RemoveElement(row);
}
if (itsBroadcast)
{
Broadcast(GRaggedFloatTableData::ElementRemoved(row, col));
}
if (GetMaxRowCount() == GetRowCount() - 2)
{
if (itsBroadcast)
{
Broadcast(JTableData::RowsRemoved(GetRowCount(), 1));
}
RowsDeleted(1);
}
}
示例2: 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 );
}
示例3: 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();
}
}