diff options
Diffstat (limited to 'sot/source/sdstor/stgcache.hxx')
-rw-r--r-- | sot/source/sdstor/stgcache.hxx | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/sot/source/sdstor/stgcache.hxx b/sot/source/sdstor/stgcache.hxx index 38e8e3428331..9b47cffed6c8 100644 --- a/sot/source/sdstor/stgcache.hxx +++ b/sot/source/sdstor/stgcache.hxx @@ -44,9 +44,9 @@ class StorageBase; class StgCache { StgPage* pCur; // top of LRU list StgPage* pElem1; // top of ordered list - ULONG nError; // error code - INT32 nPages; // size of data area in pages - USHORT nRef; // reference count + sal_uLong nError; // error code + sal_Int32 nPages; // size of data area in pages + sal_uInt16 nRef; // reference count void * pLRUCache; // hash table of cached objects short nPageSize; // page size of the file UCBStorageStream* pStorageStream; // holds reference to UCB storage stream @@ -54,40 +54,40 @@ class StgCache { void Erase( StgPage* ); // delete a cache element void InsertToLRU( StgPage* ); // insert into LRU list void InsertToOrdered( StgPage* ); // insert into ordered list - StgPage* Create( INT32 ); // create a cached page + StgPage* Create( sal_Int32 ); // create a cached page protected: SvStream* pStrm; // physical stream - BOOL bMyStream; // TRUE: delete stream in dtor - BOOL bFile; // TRUE: file stream - INT32 Page2Pos( INT32 ); // page address --> file position - INT32 Pos2Page( INT32 ); // file position --> page address + sal_Bool bMyStream; // sal_True: delete stream in dtor + sal_Bool bFile; // sal_True: file stream + sal_Int32 Page2Pos( sal_Int32 ); // page address --> file position + sal_Int32 Pos2Page( sal_Int32 ); // file position --> page address public: StgCache(); ~StgCache(); void IncRef() { nRef++; } - USHORT DecRef() { return --nRef; } + sal_uInt16 DecRef() { return --nRef; } void SetPhysPageSize( short ); - INT32 GetPhysPages() { return nPages; } + sal_Int32 GetPhysPages() { return nPages; } short GetPhysPageSize() { return nPageSize; } SvStream* GetStrm() { return pStrm; } - void SetStrm( SvStream*, BOOL ); + void SetStrm( SvStream*, sal_Bool ); void SetStrm( UCBStorageStream* ); - BOOL IsWritable() { return pStrm->IsWritable(); } - BOOL Good() { return BOOL( nError == SVSTREAM_OK ); } - BOOL Bad() { return BOOL( nError != SVSTREAM_OK ); } - ULONG GetError() { return nError; } + sal_Bool IsWritable() { return pStrm->IsWritable(); } + sal_Bool Good() { return sal_Bool( nError == SVSTREAM_OK ); } + sal_Bool Bad() { return sal_Bool( nError != SVSTREAM_OK ); } + sal_uLong GetError() { return nError; } void MoveError( StorageBase& ); - void SetError( ULONG ); + void SetError( sal_uLong ); void ResetError(); - BOOL Open( const String& rName, StreamMode ); + sal_Bool Open( const String& rName, StreamMode ); void Close(); - BOOL Read( INT32 nPage, void* pBuf, INT32 nPages ); - BOOL Write( INT32 nPage, void* pBuf, INT32 nPages ); - BOOL SetSize( INT32 nPages ); - StgPage* Find( INT32 ); // find a cached page - StgPage* Get( INT32, BOOL ); // get a cached page - StgPage* Copy( INT32, INT32=STG_FREE ); // copy a page - BOOL Commit( StgDirEntry* = NULL ); // flush all pages + sal_Bool Read( sal_Int32 nPage, void* pBuf, sal_Int32 nPages ); + sal_Bool Write( sal_Int32 nPage, void* pBuf, sal_Int32 nPages ); + sal_Bool SetSize( sal_Int32 nPages ); + StgPage* Find( sal_Int32 ); // find a cached page + StgPage* Get( sal_Int32, sal_Bool ); // get a cached page + StgPage* Copy( sal_Int32, sal_Int32=STG_FREE ); // copy a page + sal_Bool Commit( StgDirEntry* = NULL ); // flush all pages void Revert( StgDirEntry* = NULL ); // revert dirty pages void Clear(); // clear the cache }; @@ -98,32 +98,32 @@ class StgPage { StgPage *pNext1, *pLast1; // LRU chain StgPage *pNext2, *pLast2; // ordered chain StgDirEntry* pOwner; // owner - INT32 nPage; // page # - BYTE* pData; // nPageSize characters + sal_Int32 nPage; // page # + sal_uInt8* pData; // nPageSize characters short nData; // size of this page - BOOL bDirty; // dirty flag + sal_Bool bDirty; // dirty flag StgPage( StgCache*, short ); ~StgPage(); public: - void SetDirty() { bDirty = TRUE; } - INT32 GetPage() { return nPage; } + void SetDirty() { bDirty = sal_True; } + sal_Int32 GetPage() { return nPage; } void* GetData() { return pData; } short GetSize() { return nData; } void SetOwner( StgDirEntry* p ) { pOwner = p; } // routines for accessing FAT pages // Assume that the data is a FAT page and get/put FAT data. - INT32 GetPage( short nOff ) + sal_Int32 GetPage( short nOff ) { - if( ( nOff >= (short) ( nData / sizeof( INT32 ) ) ) || nOff < 0 ) + if( ( nOff >= (short) ( nData / sizeof( sal_Int32 ) ) ) || nOff < 0 ) return -1; - INT32 n = ((INT32*) pData )[ nOff ]; + sal_Int32 n = ((sal_Int32*) pData )[ nOff ]; #ifdef OSL_BIGENDIAN return SWAPLONG(n); #else return n; #endif } - void SetPage( short, INT32 ); // put an element + void SetPage( short, sal_Int32 ); // put an element }; #endif |