本文整理汇总了C++中c4_ColOfInts::IsDirty方法的典型用法代码示例。如果您正苦于以下问题:C++ c4_ColOfInts::IsDirty方法的具体用法?C++ c4_ColOfInts::IsDirty怎么用?C++ c4_ColOfInts::IsDirty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类c4_ColOfInts
的用法示例。
在下文中一共展示了c4_ColOfInts::IsDirty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ItemLenOffCol
void c4_FormatB::Commit(c4_SaveContext &ar_) {
int rows = _memos.GetSize();
d4_assert(rows > 0);
bool full = _recalc || ar_.Serializing();
if (!full)
for (int i = 0; i < rows; ++i) {
c4_Column *col = (c4_Column*)_memos.GetAt(i);
if (col != 0) {
full = true;
break;
}
}
d4_assert(_recalc || _sizeCol.RowCount() == rows);
if (full) {
_memoCol.SetBuffer(0);
_sizeCol.SetBuffer(0);
_sizeCol.SetAccessWidth(0);
_sizeCol.SetRowCount(rows);
int skip = 0;
c4_Column *saved = ar_.SetWalkBuffer(&_memoCol);
for (int r = 0; r < rows; ++r) {
++skip;
t4_i32 start;
c4_Column *col;
int len = ItemLenOffCol(r, start, col);
bool oldMemo = col != &_data;
bool newMemo = ShouldBeMemo(len);
if (!oldMemo && newMemo) {
col = GetNthMemoCol(r, true);
d4_assert(col != &_data);
//? start = 0;
}
c4_Bytes temp;
if (newMemo) {
// it now is a memo, inlined data will be empty
ar_.StoreValue(skip - 1);
skip = 0;
ar_.CommitColumn(*col);
} else if (!oldMemo) {
// it was no memo, done if it hasn't become one
_sizeCol.SetInt(r, len);
continue;
} else {
// it was a memo, but it no longer is
d4_assert(start == 0);
if (len > 0) {
_sizeCol.SetInt(r, len);
col->FetchBytes(start, len, temp, true);
delete (c4_Column*)_memos.GetAt(r); // 28-11-2001: fix mem leak
_memos.SetAt(r, 0); // 02-11-2001: fix for use after commit
}
}
SetOne(r, temp, true); // bypass current memo pointer
}
ar_.SetWalkBuffer(saved);
}
ar_.CommitColumn(_data);
if (_data.ColSize() > 0) {
_sizeCol.FixSize(true);
ar_.CommitColumn(_sizeCol);
//_sizeCol.FixSize(false);
}
ar_.CommitColumn(_memoCol);
// need a way to find out when the data has been committed (on 2nd pass)
// both _sizeCol and _memoCol will be clean again when it has
// but be careful because dirty flag is only useful if size is nonzero
if (_recalc && !ar_.Serializing())
_recalc = _sizeCol.ColSize() > 0 && _sizeCol.IsDirty() || _memoCol.ColSize()
> 0 && _memoCol.IsDirty();
}