20#ifndef INCLUDED_SOT_SOURCE_SDSTOR_STGCACHE_HXX
21#define INCLUDED_SOT_SOURCE_SDSTOR_STGCACHE_HXX
24#include <osl/endian.h>
31#include <unordered_map>
39 typedef std::unordered_map
44 typedef std::vector< rtl::Reference< StgPage > >
LRUList;
61 sal_Int32
Page2Pos( sal_Int32 )
const;
80 bool Read( sal_Int32 nPage,
void* pBuf );
81 bool Write( sal_Int32 nPage,
void const * pBuf );
88 bool SetSize( sal_Int32 nPages );
99 std::unique_ptr<sal_uInt8[]>
102 StgPage(
short nData, sal_Int32 nPage );
121 sal_Int32
n =
static_cast<sal_Int32*
>(rPage->GetData())[ nOff ];
123 return OSL_SWAPDWORD(
n);
bool Open(const OUString &rName, StreamMode)
static sal_Int32 GetFromPage(const rtl::Reference< StgPage > &rPage, short nOff)
UCBStorageStream * m_pStorageStream
std::unordered_map< sal_Int32, rtl::Reference< StgPage > > IndexToStgPage
ErrCode const & GetError() const
rtl::Reference< StgPage > Get(sal_Int32, bool)
rtl::Reference< StgPage > Copy(sal_Int32, sal_Int32=STG_FREE)
bool Write(sal_Int32 nPage, void const *pBuf)
short GetPhysPageSize() const
std::vector< rtl::Reference< StgPage > > LRUList
rtl::Reference< StgPage > Find(sal_Int32)
void SetPhysPageSize(short)
void MoveError(StorageBase const &)
IndexToStgPage maDirtyPages
rtl::Reference< StgPage > Create(sal_Int32)
void SetStrm(SvStream *, bool)
void Erase(const rtl::Reference< StgPage > &)
bool SetSize(sal_Int32 nPages)
void SetToPage(const rtl::Reference< StgPage > &rPage, short nOff, sal_Int32 nVal)
sal_Int32 GetPhysPages() const
void SetDirty(const rtl::Reference< StgPage > &rPage)
sal_Int32 Page2Pos(sal_Int32) const
bool Read(sal_Int32 nPage, void *pBuf)
static rtl::Reference< StgPage > Create(short nData, sal_Int32 nPage)
sal_Int32 GetPage() const
virtual ~StgPage() override
StgPage(short nData, sal_Int32 nPage)
std::unique_ptr< sal_uInt8[]> mpData
static bool IsPageGreater(const StgPage *pA, const StgPage *pB)
StgPage & operator=(const StgPage &)=delete
StgPage(const StgPage &)=delete
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)