LibreOffice Module sot (master) 1
|
#include <stgcache.hxx>
Public Member Functions | |
StgCache () | |
~StgCache () | |
void | IncRef () |
sal_uInt16 | DecRef () |
void | SetPhysPageSize (short) |
sal_Int32 | GetPhysPages () const |
short | GetPhysPageSize () const |
SvStream * | GetStrm () |
void | SetStrm (SvStream *, bool) |
void | SetStrm (UCBStorageStream *) |
bool | Good () const |
ErrCode const & | GetError () const |
void | MoveError (StorageBase const &) |
void | SetError (ErrCode) |
void | ResetError () |
bool | Open (const OUString &rName, StreamMode) |
void | Close () |
bool | Read (sal_Int32 nPage, void *pBuf) |
bool | Write (sal_Int32 nPage, void const *pBuf) |
void | SetToPage (const rtl::Reference< StgPage > &rPage, short nOff, sal_Int32 nVal) |
void | SetDirty (const rtl::Reference< StgPage > &rPage) |
bool | SetSize (sal_Int32 nPages) |
rtl::Reference< StgPage > | Find (sal_Int32) |
rtl::Reference< StgPage > | Get (sal_Int32, bool) |
rtl::Reference< StgPage > | Copy (sal_Int32, sal_Int32=STG_FREE) |
bool | Commit () |
void | Clear () |
Static Public Member Functions | |
static sal_Int32 | GetFromPage (const rtl::Reference< StgPage > &rPage, short nOff) |
Protected Member Functions | |
sal_Int32 | Page2Pos (sal_Int32) const |
Protected Attributes | |
bool | m_bFile |
Private Types | |
typedef std::unordered_map< sal_Int32, rtl::Reference< StgPage > > | IndexToStgPage |
typedef std::vector< rtl::Reference< StgPage > > | LRUList |
Private Member Functions | |
void | Erase (const rtl::Reference< StgPage > &) |
rtl::Reference< StgPage > | Create (sal_Int32) |
Private Attributes | |
ErrCode | m_nError |
sal_Int32 | m_nPages |
sal_uInt16 | m_nRef |
IndexToStgPage | maDirtyPages |
int | m_nReplaceIdx |
LRUList | maLRUPages |
short | m_nPageSize |
UCBStorageStream * | m_pStorageStream |
SvStream * | m_pStrm |
bool | m_bMyStream |
Definition at line 37 of file stgcache.hxx.
|
private |
Definition at line 42 of file stgcache.hxx.
|
private |
Definition at line 44 of file stgcache.hxx.
StgCache::StgCache | ( | ) |
Definition at line 84 of file stgcache.cxx.
References ERRCODE_NONE, m_nPageSize, and m_nRef.
StgCache::~StgCache | ( | ) |
Definition at line 98 of file stgcache.cxx.
void StgCache::Clear | ( | ) |
Definition at line 139 of file stgcache.cxx.
References maDirtyPages, and maLRUPages.
Referenced by ~StgCache().
void StgCache::Close | ( | ) |
Definition at line 301 of file stgcache.cxx.
References Close(), SvStream::GetError(), m_bFile, m_pStrm, and SetError().
Referenced by Close().
bool StgCache::Commit | ( | ) |
Definition at line 204 of file stgcache.cxx.
References SvStream::Flush(), SvStream::GetError(), Good(), StgPage::IsPageGreater(), m_pStrm, maDirtyPages, SetError(), and Write().
Referenced by StgIo::CommitAll().
rtl::Reference< StgPage > StgCache::Copy | ( | sal_Int32 | nNew, |
sal_Int32 | nOld = STG_FREE |
||
) |
Definition at line 182 of file stgcache.cxx.
References Create(), Find(), Get(), p, and SetDirty().
Referenced by StgStrm::Copy(), StgFATStrm::GetPage(), StgFAT::InitNew(), StgFATStrm::SetSize(), and StgDataStrm::SetSize().
|
private |
Definition at line 117 of file stgcache.cxx.
References StgPage::Create(), m_nPageSize, m_nReplaceIdx, and maLRUPages.
|
inline |
Definition at line 66 of file stgcache.hxx.
References m_nRef.
Referenced by OLEStorageBase::~OLEStorageBase().
|
private |
rtl::Reference< StgPage > StgCache::Find | ( | sal_Int32 | nPage | ) |
Definition at line 148 of file stgcache.cxx.
References maDirtyPages, and maLRUPages.
Referenced by Copy(), Get(), StgDataStrm::Read(), and StgDataStrm::Write().
rtl::Reference< StgPage > StgCache::Get | ( | sal_Int32 | nPage, |
bool | bForce | ||
) |
Definition at line 162 of file stgcache.cxx.
References Create(), Erase(), Find(), p, Read(), SetError(), and SVSTREAM_READ_ERROR.
Referenced by Copy(), StgFATStrm::GetPage(), StgFAT::GetPhysPage(), StgDataStrm::GetPtr(), StgDataStrm::Read(), StgFATStrm::SetPage(), StgFATStrm::SetSize(), and StgDataStrm::Write().
|
inline |
Definition at line 74 of file stgcache.hxx.
References m_nError.
Referenced by StgIo::SetupStreams(), and StgDirStrm::StgDirStrm().
|
inlinestatic |
Definition at line 117 of file stgcache.hxx.
References o3tl::make_unsigned(), and n.
Referenced by StgFAT::FindBlock(), StgFAT::FreePages(), StgFAT::GetNextPage(), StgFATStrm::GetPage(), StgFATStrm::SetPage(), and StgFATStrm::SetSize().
|
inline |
Definition at line 68 of file stgcache.hxx.
References m_nPages.
Referenced by StgFATStrm::GetPage(), StgFATStrm::SetSize(), and StgDataStrm::SetSize().
|
inline |
|
inline |
Definition at line 70 of file stgcache.hxx.
References m_pStrm.
Referenced by StgIo::CommitAll(), StgIo::Load(), StgHeader::Load(), StgDirStrm::SetupEntry(), StgHeader::Store(), and StgIo::ValidateFATs().
|
inline |
Definition at line 73 of file stgcache.hxx.
References ERRCODE_NONE, and m_nError.
Referenced by Commit(), StgIo::Load(), StgHeader::Load(), Open(), Read(), SetSize(), StgHeader::Store(), and Write().
|
inline |
Definition at line 65 of file stgcache.hxx.
References m_nRef.
void StgCache::MoveError | ( | StorageBase const & | r | ) |
Definition at line 413 of file stgcache.cxx.
References ERRCODE_NONE, m_nError, ResetError(), and StorageBase::SetError().
Referenced by StorageStream::Commit(), StorageStream::CopyTo(), StorageStream::Read(), StorageStream::SetSize(), and StorageStream::Write().
bool StgCache::Open | ( | const OUString & | rName, |
StreamMode | nMode | ||
) |
Definition at line 274 of file stgcache.cxx.
References SvFileStream::Close(), ERRCODE_IO_ACCESSDENIED, SvStream::GetError(), Good(), SvFileStream::IsOpen(), SvStream::IsWritable(), lcl_GetPageCount(), m_bFile, m_nPages, m_nPageSize, m_pStrm, SvStream::Seek(), SetError(), SetStrm(), and SvStream::TellEnd().
Referenced by StgIo::ValidateFATs().
|
protected |
Definition at line 424 of file stgcache.cxx.
References m_nPageSize.
bool StgCache::Read | ( | sal_Int32 | nPage, |
void * | pBuf | ||
) |
Definition at line 312 of file stgcache.cxx.
References SvStream::GetError(), Good(), m_nPages, m_nPageSize, m_pStrm, nPos, Page2Pos(), SvStream::ReadBytes(), SvStream::Seek(), SetError(), SVSTREAM_READ_ERROR, and SvStream::Tell().
Referenced by Get(), and StgDataStrm::Read().
void StgCache::ResetError | ( | ) |
Definition at line 407 of file stgcache.cxx.
References ERRCODE_NONE, m_nError, m_pStrm, and SvStream::ResetError().
Referenced by MoveError(), and StgIo::SetupStreams().
void StgCache::SetDirty | ( | const rtl::Reference< StgPage > & | rPage | ) |
Definition at line 266 of file stgcache.cxx.
References SvStream::IsWritable(), m_pStrm, and maDirtyPages.
Referenced by Copy(), StgDataStrm::GetPtr(), SetToPage(), and StgDataStrm::Write().
void StgCache::SetError | ( | ErrCode | n | ) |
Definition at line 401 of file stgcache.cxx.
Referenced by StgFAT::AllocPages(), Close(), Commit(), StgIo::CommitAll(), StgStrm::Copy(), StgDirStrm::Create(), Get(), StgFATStrm::GetPage(), Open(), Read(), StgStrm::scanBuildPageChainCache(), StgFATStrm::SetPage(), SetSize(), StgDirEntry::SetSize(), StgDirStrm::SetupEntry(), StgIo::SetupStreams(), StgDirEntry::Strm2Tmp(), StgDirEntry::Tmp2Strm(), StgDirEntry::Write(), and Write().
void StgCache::SetPhysPageSize | ( | short | n | ) |
Definition at line 104 of file stgcache.cxx.
References lcl_GetPageCount(), m_nPages, m_nPageSize, m_pStrm, n, and SvStream::TellEnd().
Referenced by StgIo::SetupStreams().
bool StgCache::SetSize | ( | sal_Int32 | nPages | ) |
Definition at line 390 of file stgcache.cxx.
References SvStream::GetError(), Good(), m_nError, m_nPages, m_nPageSize, m_pStrm, n, SetError(), and SvStream::SetStreamSize().
Referenced by StgFATStrm::GetPage(), StgFATStrm::SetSize(), and StgDataStrm::SetSize().
void StgCache::SetStrm | ( | SvStream * | p, |
bool | bMy | ||
) |
Definition at line 232 of file stgcache.cxx.
References m_bMyStream, m_pStorageStream, m_pStrm, p, and SvRefBase::ReleaseRef().
Referenced by Open(), and ~StgCache().
void StgCache::SetStrm | ( | UCBStorageStream * | pStgStream | ) |
Definition at line 246 of file stgcache.cxx.
References SvRefBase::AddFirstRef(), UCBStorageStream::GetModifySvStream(), m_bMyStream, m_pStorageStream, m_pStrm, and SvRefBase::ReleaseRef().
void StgCache::SetToPage | ( | const rtl::Reference< StgPage > & | rPage, |
short | nOff, | ||
sal_Int32 | nVal | ||
) |
Definition at line 55 of file stgcache.cxx.
References o3tl::make_unsigned(), and SetDirty().
Referenced by StgFAT::AllocPages(), StgFAT::FreePages(), StgFATStrm::GetPage(), StgFAT::InitNew(), StgFAT::MakeChain(), StgFATStrm::SetPage(), and StgFATStrm::SetSize().
bool StgCache::Write | ( | sal_Int32 | nPage, |
void const * | pBuf | ||
) |
Definition at line 361 of file stgcache.cxx.
References SvStream::GetError(), Good(), m_nPageSize, m_pStrm, nPos, Page2Pos(), SvStream::Seek(), SetError(), SVSTREAM_WRITE_ERROR, SvStream::Tell(), and SvStream::WriteBytes().
Referenced by Commit(), and StgDataStrm::Write().
|
protected |
Definition at line 60 of file stgcache.hxx.
Referenced by Close(), Open(), and StgIo::ValidateFATs().
|
private |
Definition at line 58 of file stgcache.hxx.
Referenced by SetStrm().
|
private |
Definition at line 46 of file stgcache.hxx.
Referenced by GetError(), Good(), MoveError(), ResetError(), SetError(), and SetSize().
|
private |
Definition at line 47 of file stgcache.hxx.
Referenced by GetPhysPages(), Open(), Read(), SetPhysPageSize(), and SetSize().
|
private |
Definition at line 52 of file stgcache.hxx.
Referenced by Create(), GetPhysPageSize(), Open(), Page2Pos(), Read(), SetPhysPageSize(), SetSize(), and Write().
|
private |
Definition at line 48 of file stgcache.hxx.
|
private |
Definition at line 50 of file stgcache.hxx.
Referenced by Create().
|
private |
Definition at line 53 of file stgcache.hxx.
Referenced by SetStrm().
|
private |
Definition at line 57 of file stgcache.hxx.
Referenced by Close(), Commit(), GetStrm(), Open(), Read(), ResetError(), SetDirty(), SetPhysPageSize(), SetSize(), SetStrm(), and Write().
|
private |
Definition at line 49 of file stgcache.hxx.
Referenced by Clear(), Commit(), Find(), and SetDirty().
|
private |