mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
Fixed stream seek problem. Fixed CompoundFile::Save()
This commit is contained in:
34
Common/cfcpp/sectorcollection.h
Normal file
34
Common/cfcpp/sectorcollection.h
Normal file
@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
#include "sector.h"
|
||||
#include <list>
|
||||
#include "svector.h"
|
||||
#include "event.h"
|
||||
|
||||
namespace CFCPP
|
||||
{
|
||||
using Ver3SizeLimitReached = std::function<void()>;
|
||||
|
||||
class SectorCollection
|
||||
{
|
||||
public:
|
||||
std::vector<SVector<Sector>> largeArraySlices;
|
||||
SectorCollection();
|
||||
void Add(std::shared_ptr<Sector> item);
|
||||
void Clear();
|
||||
inline int Count()const {return count;}
|
||||
std::shared_ptr<Sector> operator[](size_t index);
|
||||
Event<Ver3SizeLimitReached> OnVer3SizeLimitReached;
|
||||
|
||||
private:
|
||||
void DoCheckSizeLimitReached();
|
||||
int add(std::shared_ptr<Sector> item);
|
||||
private:
|
||||
const int MAX_SECTOR_V4_COUNT_LOCK_RANGE = 524287; //0x7FFFFF00 for Version 4
|
||||
const int SLICE_SIZE = 4096;
|
||||
bool sizeLimitReached = false;
|
||||
|
||||
int count = 0;
|
||||
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user