Exemplo n.º 1
0
        public void Remove(uint entryId, TEntryValue value)
        {
            int entryIndex = GetEntryIndex(entryId, value);

            if (entryIndex < 0)
            {
                throw new ArgumentException("Entry ID " + entryId + " not found");
            }
            uint entryPosition = GetEntryPosition((uint)entryIndex);

            fileStream.Position = entryPosition + 4;
            valueType.Remove(fileStreamReader);
            uint num  = (uint)fileStream.Length;
            uint num2 = num - entryPosition - entrySize;
            uint num3 = num2 / 32768u;
            uint num4 = num2 % 32768u;
            uint num5 = entryPosition;
            uint num6 = num5 + entrySize;

            for (uint num7 = 0u; num7 < num3; num7++)
            {
                journalWriter.WriteCopyEntry(path, num6, 32768u, num5);
                num5 += 32768;
                num6 += 32768;
            }
            if (num4 != 0)
            {
                uint srcPosition = num5 + entrySize;
                journalWriter.WriteCopyEntry(path, srcPosition, num4, num5);
            }
            uint size = num - entrySize;

            journalWriter.WriteResizeEntry(path, size);
            Count--;
        }
Exemplo n.º 2
0
 public void JournaledClear()
 {
     journalWriter.WriteResizeEntry(documentsPath, 1u);
     journalWriter.WriteResizeEntry(pagesPath, 1u);
 }