本文整理汇总了C++中JArray::RemoveAll方法的典型用法代码示例。如果您正苦于以下问题:C++ JArray::RemoveAll方法的具体用法?C++ JArray::RemoveAll怎么用?C++ JArray::RemoveAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JArray
的用法示例。
在下文中一共展示了JArray::RemoveAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetX
void
GDBPlot2DCommand::HandleSuccess
(
const JString& data
)
{
JArray<JFloat>* x = GetX();
JArray<JFloat>* y = GetY();
if ((GetLastResult()).BeginsWith("error,msg=\"No symbol"))
{
x->RemoveAll();
y->RemoveAll();
return;
}
const JIndex count = x->GetElementCount();
JIndex i;
JIndexRange r;
JArray<JIndexRange> matchRange1, matchRange2;
JString v1, v2;
for (i=1; i<=count; i++)
{
if (!prefixPattern.MatchAfter(data, r, &matchRange1))
{
break;
}
r = matchRange1.GetElement(1);
if (!prefixPattern.MatchAfter(data, r, &matchRange2))
{
break;
}
r = matchRange2.GetElement(1);
v1 = data.GetSubstring(matchRange1.GetElement(2));
v1.TrimWhitespace();
v2 = data.GetSubstring(matchRange2.GetElement(2));
v2.TrimWhitespace();
JFloat x1, y1;
if (!v1.ConvertToFloat(&x1) ||
!v2.ConvertToFloat(&y1))
{
break;
}
x->SetElement(i, x1);
y->SetElement(i, y1);
}
if (i <= count)
{
const JSize delta = count - (i-1);
x->RemoveNextElements(count - delta + 1, delta);
y->RemoveNextElements(count - delta + 1, delta);
}
}
示例2: GetSubject
const JString&
GMessageHeader::GetBaseSubject()
{
if (itsHasBaseSubject)
{
return itsBaseSubject;
}
itsHasBaseSubject = kJTrue;
itsBaseSubject = GetSubject();
kFixSubjectRegex.SetCaseSensitive(kJFalse);
JArray<JIndexRange> subList;
while (kFixSubjectRegex.Match(itsBaseSubject, &subList))
{
itsBaseSubject = itsBaseSubject.GetSubstring(subList.GetElement(subList.GetElementCount()));
itsBaseSubject.TrimWhitespace();
subList.RemoveAll();
}
const JSize length = itsBaseSubject.GetLength();
JIndex findex = 1;
while (findex <= length &&
!isalnum(itsBaseSubject.GetCharacter(findex)))
{
findex++;
}
if (findex > 1 && findex <= length)
{
itsBaseSubject = itsBaseSubject.GetSubstring(findex, length);
}
return itsBaseSubject;
}
示例3: GetRowCount
void
GRaggedFloatTableData::RemoveAllRows()
{
const JSize colCount = itsCols->GetElementCount();
for (JIndex i=1; i<=colCount; i++)
{
JArray<JFloat>* colData = itsCols->NthElement(i);
colData->RemoveAll();
}
const JSize count = GetRowCount();
SetRowCount(0);
if (itsBroadcast)
{
Broadcast(JTableData::RowsRemoved(1, count));
}
RowsAdded(1);
if (itsBroadcast)
{
Broadcast(JTableData::RowsInserted(1, 1));
}
}