本文整理汇总了C++中ObjectArray::append方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectArray::append方法的具体用法?C++ ObjectArray::append怎么用?C++ ObjectArray::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectArray
的用法示例。
在下文中一共展示了ObjectArray::append方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reloadFile
void TextData::reloadFile()
{
File file(this->fileName);
long oldLength = getLength();
long oldNumberLines = this->numberLines;
ObjectArray<LineAndColumn> oldMarkPositions;
for (long i = 0; i < marks.getLength(); ++i) {
if (marks[i].inUseCounter > 0) {
oldMarkPositions.append(LineAndColumn(marks[i].line,
getWCharColumn(marks[i])));
} else {
oldMarkPositions.append(LineAndColumn(0, 0));
}
}
Nullable<FileException> fileException;
try {
file.loadInto(&buffer);
} catch (FileException& ex) {
fileException = ex;
}
EncodingConverter c(fileContentEncoding, "UTF-8");
if (c.isConvertingBetweenDifferentCodesets())
{
c.convertInPlace(&buffer);
}
long len = buffer.getLength();
byte* ptr = buffer.getTotalAmount();
this->numberLines = 1;
for (long i = 0; i < len; ++i) {
if (ptr[i] == '\n') {
++this->numberLines;
}
}
this->beginChangedPos = 0;
this->changedAmount = len - oldLength;
this->oldEndChangedPos = oldLength;
updateMarks(0, oldLength, len - oldLength, // long beginChangedPos, long oldEndChangedPos, long changedAmount,
0, this->numberLines - oldNumberLines); // long beginLineNumber, long changedLineNumberAmount)
for (long i = 0; i < marks.getLength(); ++i) {
if (marks[i].inUseCounter > 0) {
moveMarkToLineAndWCharColumn(MarkHandle(i), oldMarkPositions[i].line,
oldMarkPositions[i].wcharColumn);
}
}
setModifiedFlag(false);
this->fileInfo = file.getInfo();
this->modifiedOnDiskFlag = false;
this->ignoreModifiedOnDiskFlag = false;
if (!fileException.isValid()) {
if (isReadOnlyFlag != !fileInfo.isWritable()) {
isReadOnlyFlag = !fileInfo.isWritable();
readOnlyListeners.invokeAllCallbacks(isReadOnlyFlag);
}
clearHistory();
}
if (fileException.isValid()) {
throw fileException.get();
}
}