27#include <rtl/string.h>
84 void guard()
const { (void)
this; }
152 return sal_uInt16(
capacity(rDescr) /
sizeof(sal_uInt32));
156 return sal_uInt16(
capacity() /
sizeof(sal_uInt32));
296 nCRC32 = rtl_crc32 (nCRC32, &
m_aKey,
static_cast<sal_uInt32
>(
theSize -
sizeof(
G)));
305 nCRC32 = rtl_crc32 (nCRC32, &
m_aKey,
static_cast<sal_uInt32
>(
theSize -
sizeof(
G)));
313#define STORE_LIMIT_DATAPAGE_DIRECT 16
314#define STORE_LIMIT_DATAPAGE_SINGLE 8
315#define STORE_LIMIT_DATAPAGE_DOUBLE 1
316#define STORE_LIMIT_DATAPAGE_TRIPLE 1
393 nCRC32 = rtl_crc32 (nCRC32, &
m_aTable,
static_cast<sal_uInt32
>(
theSize -
sizeof(
G)));
402 nCRC32 = rtl_crc32 (nCRC32, &
m_aTable,
static_cast<sal_uInt32
>(
theSize -
sizeof(
G)));
478#define STORE_MAGIC_DIRECTORYPAGE sal_uInt32(0x62190120)
553 :
m_nPage(nPosition / nCapacity),
554 m_nOffset(static_cast<sal_uInt16>((nPosition % nCapacity) & 0xffff)),
579 if (nPosition < nCapacity)
631 const char * pszName = rPage.m_aNameBlock.m_pData;
632 sal_uInt32 nPath =
store::ntohl(rPage.m_aNameBlock.m_aKey.m_nHigh);
633 return rtl_crc32 (nPath, pszName, rtl_str_getLength(pszName));
722 OSL_PRECOND(pImpl !=
nullptr,
"OStoreDirectoryPageObject::PAGE(): Null pointer");
728 OSL_PRECOND(pImpl !=
nullptr,
"OStoreDirectoryPageObject::PAGE(): Null pointer");
736 page::DataBlock::LinkDescriptor &rDescr)
const;
OStoreDataPageObject(std::shared_ptr< PageData > const &rxPage=std::shared_ptr< PageData >())
Construction.
virtual storeError guard(sal_uInt32 nAddr) override
External representation.
virtual storeError verify(sal_uInt32 nAddr) const override
page::ChunkScope scope(sal_uInt32 nPage, page::DataBlock::LinkDescriptor &rDescr) const
scope (external data page; private).
void directLink(sal_uInt16 nIndex, sal_uInt32 nAddr)
virtual storeError guard(sal_uInt32 nAddr) override
External representation.
storeError write(sal_uInt32 nPage, OStoreDataPageObject &rData, OStorePageBIOS &rBIOS)
write (external data page).
sal_uInt32 singleLink(sal_uInt16 nIndex) const
single indirect.
OStoreDirectoryPageObject(std::shared_ptr< PageData > const &rxPage=std::shared_ptr< PageData >())
Construction.
void doubleLink(sal_uInt16 nIndex, sal_uInt32 nAddr)
page & PAGE()
Representation.
page const & PAGE() const
virtual storeError verify(sal_uInt32 nAddr) const override
sal_uInt32 attrib() const
attrib.
void key(OStorePageKey const &rKey)
key.
sal_uInt32 path() const
path.
OStoreIndirectionPageData indirect
storeError read(sal_uInt32 nPage, OStoreDataPageObject &rData, OStorePageBIOS &rBIOS) const
read (external data page).
void attrib(sal_uInt32 nAttrib)
void dataLength(sal_uInt32 nLength)
sal_uInt32 tripleLink(sal_uInt16 nIndex) const
triple indirect.
sal_uInt32 directLink(sal_uInt16 nIndex) const
direct.
sal_uInt32 dataLength() const
dataLength.
OStoreDirectoryPageData page
void singleLink(sal_uInt16 nIndex, sal_uInt32 nAddr)
storeError truncate(sal_uInt32 nPage, OStorePageBIOS &rBIOS)
truncate (external data page).
void tripleLink(sal_uInt16 nIndex, sal_uInt32 nAddr)
sal_uInt32 doubleLink(sal_uInt16 nIndex) const
double indirect.
storeError truncate(sal_uInt16 nSingle, OStorePageBIOS &rBIOS)
truncate (indirect data page).
virtual storeError guard(sal_uInt32 nAddr) override
virtual storeError verify(sal_uInt32 nAddr) const override
storeError loadOrCreate(sal_uInt32 nAddr, OStorePageBIOS &rBIOS)
External representation.
storeError read(sal_uInt16 nSingle, OStoreDataPageObject &rData, OStorePageBIOS &rBIOS) const
read (indirect data page).
OStoreIndirectionPageData page
OStoreIndirectionPageObject(std::shared_ptr< PageData > const &rxPage=std::shared_ptr< PageData >())
Construction.
storeError write(sal_uInt16 nSingle, OStoreDataPageObject &rData, OStorePageBIOS &rBIOS)
write (indirect data page).
std::shared_ptr< PageData > m_xPage
Representation.
Old OStorePageCache implementation.
sal_uInt32 htonl(sal_uInt32 h)
constexpr sal_uInt32 STORE_MAGIC_DATAPAGE(0x94190310)
sal_uInt16 ntohs(sal_uInt16 n)
sal_uInt32 ntohl(sal_uInt32 n)
sal_uInt16 htons(sal_uInt16 h)
constexpr sal_uInt32 STORE_MAGIC_INDIRECTPAGE(0x89191107)
#define STORE_LIMIT_DATAPAGE_DIRECT
#define STORE_LIMIT_DATAPAGE_SINGLE
#define STORE_LIMIT_DATAPAGE_DOUBLE
#define STORE_LIMIT_DATAPAGE_TRIPLE
#define STORE_MAGIC_DIRECTORYPAGE
OStoreDataPageData(sal_uInt16 nPageSize)
Construction.
static const sal_uInt16 thePageSize
sal_uInt8 m_pData[1]
Representation.
sal_uInt16 capacity() const
static const sal_uInt32 theTypeId
type.
static const size_t theSize
size.
void guard() const
guard (external representation).
static sal_uInt16 capacity(const D &rDescr)
capacity.
storeError verify() const
verify (external representation).
LinkDescriptor()
Construction.
sal_uInt16 m_nIndex0
Representation.
sal_uInt32 m_pTriple[STORE_LIMIT_DATAPAGE_TRIPLE]
sal_uInt32 m_pSingle[STORE_LIMIT_DATAPAGE_SINGLE]
void initialize()
initialize.
sal_uInt32 m_pDirect[STORE_LIMIT_DATAPAGE_DIRECT]
Representation.
sal_uInt32 m_pDouble[STORE_LIMIT_DATAPAGE_DOUBLE]
static const sal_uInt16 singleCount
single.
void doubleLink(sal_uInt16 nIndex, sal_uInt32 nAddr)
static const sal_uInt16 directCount
direct.
void singleLink(sal_uInt16 nIndex, sal_uInt32 nAddr)
void directLink(sal_uInt16 nIndex, sal_uInt32 nAddr)
G m_aGuard
Representation.
void guard()
guard (external representation).
OStoreDirectoryDataBlock()
Construction.
sal_uInt32 doubleLink(sal_uInt16 nIndex) const
void tripleLink(sal_uInt16 nIndex, sal_uInt32 nAddr)
static const sal_uInt16 tripleCount
triple.
storeError verify() const
verify (external representation).
sal_uInt32 directLink(sal_uInt16 nIndex) const
static const sal_uInt16 doubleCount
double.
static const size_t theSize
size.
sal_uInt32 tripleLink(sal_uInt16 nIndex) const
sal_uInt32 singleLink(sal_uInt16 nIndex) const
ChunkDescriptor(sal_uInt32 nPosition, sal_uInt16 nCapacity)
Construction.
sal_uInt32 m_nPage
Representation.
static const size_t theSize
size.
static const sal_uInt16 thePageSize
void guard()
guard (external representation).
OStoreDirectoryDataBlock DataBlock
sal_uInt16 capacity() const
capacity.
OStorePageNameBlock NameBlock
OStoreDirectoryPageData self
storeError verify() const
verify (external representation).
NameBlock m_aNameBlock
Representation.
ChunkScope scope(sal_uInt32 nPosition) const
scope (internal).
OStoreDirectoryPageData(sal_uInt16 nPageSize)
Construction.
static const sal_uInt32 theTypeId
type.
static const sal_uInt32 theTypeId
type.
OStoreIndirectionPageData self
void guard()
guard (external representation).
sal_uInt16 capacityCount() const
static const size_t theSize
size.
sal_uInt16 capacity() const
storeError verify() const
verify (external representation).
static sal_uInt16 capacity(const D &rDescr)
capacity.
G m_aGuard
Representation.
static sal_uInt16 capacityCount(const D &rDescr)
capacityCount.
static const sal_uInt16 thePageSize
OStoreIndirectionPageData(sal_uInt16 nPageSize)
Construction.
sal_uInt32 m_nMagic
Representation.
storeError verify() const
verify (external representation).
void guard()
guard (external representation).
OStorePageNameBlock()=default
Construction.
static const size_t theSize
size.
G m_aGuard
Representation.
char m_pData[STORE_MAXIMUM_NAMESIZE]
G m_aGuard
Representation.
static const size_t theSize
theSize.
constexpr sal_uInt16 STORE_MINIMUM_PAGESIZE
PageSize (enforced) limits.
storeError
Error Code enumeration.
@ store_E_InvalidChecksum
constexpr auto STORE_MAXIMUM_NAMESIZE
NameSize (enforced) limit.