office-gobmx/store/source/store.cxx

766 lines
20 KiB
C++
Raw Normal View History

2000-09-18 09:18:43 -05:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2000-09-18 09:18:43 -05:00
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
2000-09-18 09:18:43 -05:00
*
* OpenOffice.org - a multi-platform office productivity suite
2000-09-18 09:18:43 -05:00
*
* This file is part of OpenOffice.org.
2000-09-18 09:18:43 -05:00
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
2000-09-18 09:18:43 -05:00
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
2000-09-18 09:18:43 -05:00
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
2000-09-18 09:18:43 -05:00
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_store.hxx"
#include "store/store.h"
2000-09-18 09:18:43 -05:00
#include <sal/types.h>
#include <rtl/memory.h>
#include <rtl/string.hxx>
#include <rtl/ref.hxx>
#include "object.hxx"
#include "lockbyte.hxx"
#include "storbase.hxx"
#include "storpage.hxx"
#include "stordir.hxx"
#include "storlckb.hxx"
2000-09-18 09:18:43 -05:00
using rtl::Reference;
using rtl::OString;
2000-09-18 09:18:43 -05:00
namespace store
{
/** Template helper class as type safe Reference to store_handle_type.
*/
template<class store_handle_type>
class OStoreHandle : public rtl::Reference<store_handle_type>
{
public:
OStoreHandle (store_handle_type * pHandle)
: rtl::Reference<store_handle_type> (pHandle)
{}
static store_handle_type * SAL_CALL query (void * pHandle)
{
return store::query (
static_cast<IStoreHandle*>(pHandle),
static_cast<store_handle_type*>(0));
}
};
}
using namespace store;
2000-09-18 09:18:43 -05:00
/*========================================================================
*
* storeHandle implementation.
*
*======================================================================*/
/*
* store_acquireHandle.
*/
storeError SAL_CALL store_acquireHandle (
storeHandle Handle
) SAL_THROW_EXTERN_C()
2000-09-18 09:18:43 -05:00
{
IStoreHandle *pHandle = static_cast<IStoreHandle*>(Handle);
if (!pHandle)
2000-09-18 09:18:43 -05:00
return store_E_InvalidHandle;
pHandle->acquire();
2000-09-18 09:18:43 -05:00
return store_E_None;
}
/*
* store_releaseHandle.
*/
storeError SAL_CALL store_releaseHandle (
storeHandle Handle
) SAL_THROW_EXTERN_C()
2000-09-18 09:18:43 -05:00
{
IStoreHandle *pHandle = static_cast<IStoreHandle*>(Handle);
if (!pHandle)
2000-09-18 09:18:43 -05:00
return store_E_InvalidHandle;
pHandle->release();
2000-09-18 09:18:43 -05:00
return store_E_None;
}
/*========================================================================
*
* storeFileHandle implementation.
*
*======================================================================*/
/*
* store_createMemoryFile.
*/
storeError SAL_CALL store_createMemoryFile (
sal_uInt16 nPageSize,
storeFileHandle *phFile
) SAL_THROW_EXTERN_C()
2000-09-18 09:18:43 -05:00
{
if (!phFile)
return store_E_InvalidParameter;
*phFile = NULL;
Reference<ILockBytes> xLockBytes;
storeError eErrCode = MemoryLockBytes_createInstance(xLockBytes);
if (eErrCode != store_E_None)
return eErrCode;
OSL_ASSERT(xLockBytes.is());
2000-09-18 09:18:43 -05:00
Reference<OStorePageManager> xManager (new OStorePageManager());
if (!xManager.is())
2000-09-18 09:18:43 -05:00
return store_E_OutOfMemory;
eErrCode = xManager->initialize (
2000-09-18 09:18:43 -05:00
&*xLockBytes, store_AccessCreate, nPageSize);
if (eErrCode != store_E_None)
return eErrCode;
xManager->acquire();
*phFile = (storeFileHandle)&(*xManager);
return store_E_None;
}
/*
* store_openFile.
*/
storeError SAL_CALL store_openFile (
rtl_uString *pFilename,
storeAccessMode eAccessMode,
sal_uInt16 nPageSize,
storeFileHandle *phFile
) SAL_THROW_EXTERN_C()
2000-09-18 09:18:43 -05:00
{
if (phFile)
*phFile = NULL;
if (!(pFilename && phFile))
return store_E_InvalidParameter;
Reference<ILockBytes> xLockBytes;
2000-09-18 09:18:43 -05:00
storeError eErrCode = FileLockBytes_createInstance (xLockBytes, pFilename, eAccessMode);
2000-09-18 09:18:43 -05:00
if (eErrCode != store_E_None)
return eErrCode;
OSL_ASSERT(xLockBytes.is());
2000-09-18 09:18:43 -05:00
Reference<OStorePageManager> xManager (new OStorePageManager());
if (!xManager.is())
2000-09-18 09:18:43 -05:00
return store_E_OutOfMemory;
eErrCode = xManager->initialize (
&*xLockBytes, eAccessMode, nPageSize);
2000-09-18 09:18:43 -05:00
if (eErrCode != store_E_None)
return eErrCode;
xManager->acquire();
*phFile = (storeFileHandle)&(*xManager);
return store_E_None;
}
/*
* store_closeFile.
*/
storeError SAL_CALL store_closeFile (
storeFileHandle Handle
) SAL_THROW_EXTERN_C()
2000-09-18 09:18:43 -05:00
{
OStorePageManager *pManager =
OStoreHandle<OStorePageManager>::query (Handle);
if (!pManager)
2000-09-18 09:18:43 -05:00
return store_E_InvalidHandle;
storeError eErrCode = pManager->close();
pManager->release();
return eErrCode;
2000-09-18 09:18:43 -05:00
}
/*
* store_flushFile.
*/
storeError SAL_CALL store_flushFile (
storeFileHandle Handle
) SAL_THROW_EXTERN_C()
2000-09-18 09:18:43 -05:00
{
OStoreHandle<OStorePageManager> xManager (
OStoreHandle<OStorePageManager>::query (Handle));
if (!xManager.is())
2000-09-18 09:18:43 -05:00
return store_E_InvalidHandle;
return xManager->flush();
}
/*
* store_getFileRefererCount.
*/
storeError SAL_CALL store_getFileRefererCount (
storeFileHandle Handle,
sal_uInt32 *pnRefCount
) SAL_THROW_EXTERN_C()
2000-09-18 09:18:43 -05:00
{
OStoreHandle<OStorePageManager> xManager (
OStoreHandle<OStorePageManager>::query (Handle));
if (!xManager.is())
2000-09-18 09:18:43 -05:00
return store_E_InvalidHandle;
if (!pnRefCount)
return store_E_InvalidParameter;
*pnRefCount = xManager->getRefererCount();
return store_E_None;
}
/*
* store_getFileSize.
*/
storeError SAL_CALL store_getFileSize (
storeFileHandle Handle,
sal_uInt32 *pnSize
) SAL_THROW_EXTERN_C()
2000-09-18 09:18:43 -05:00
{
OStoreHandle<OStorePageManager> xManager (
OStoreHandle<OStorePageManager>::query (Handle));
if (!xManager.is())
2000-09-18 09:18:43 -05:00
return store_E_InvalidHandle;
if (!pnSize)
return store_E_InvalidParameter;
return xManager->size (*pnSize);
}
/*
* store_rebuildFile.
*/
storeError SAL_CALL store_rebuildFile (
rtl_uString *pSrcFilename,
rtl_uString *pDstFilename
) SAL_THROW_EXTERN_C()
2000-09-18 09:18:43 -05:00
{
storeError eErrCode = store_E_None;
if (!(pSrcFilename && pDstFilename))
return store_E_InvalidParameter;
Reference<OStorePageManager> xManager (new OStorePageManager());
if (!xManager.is())
2000-09-18 09:18:43 -05:00
return store_E_OutOfMemory;
Reference<ILockBytes> xSrcLB;
eErrCode = FileLockBytes_createInstance (xSrcLB, pSrcFilename, store_AccessReadOnly);
2000-09-18 09:18:43 -05:00
if (eErrCode != store_E_None)
return eErrCode;
OSL_ASSERT(xSrcLB.is());
2000-09-18 09:18:43 -05:00
Reference<ILockBytes> xDstLB;
eErrCode = FileLockBytes_createInstance (xDstLB, pDstFilename, store_AccessCreate);
2000-09-18 09:18:43 -05:00
if (eErrCode != store_E_None)
return eErrCode;
OSL_ASSERT(xDstLB.is());
2000-09-18 09:18:43 -05:00
return xManager->rebuild (&*xSrcLB, &*xDstLB);
}
/*========================================================================
*
* storeDirectoryHandle implementation.
*
*======================================================================*/
/*
* store_openDirectory.
*/
storeError SAL_CALL store_openDirectory (
storeFileHandle hFile,
rtl_uString *pPath,
rtl_uString *pName,
storeAccessMode eAccessMode,
storeDirectoryHandle *phDirectory
) SAL_THROW_EXTERN_C()
2000-09-18 09:18:43 -05:00
{
storeError eErrCode = store_E_None;
if (phDirectory)
*phDirectory = NULL;
OStoreHandle<OStorePageManager> xManager (
OStoreHandle<OStorePageManager>::query (hFile));
if (!xManager.is())
2000-09-18 09:18:43 -05:00
return store_E_InvalidHandle;
if (!(pPath && pName && phDirectory))
return store_E_InvalidParameter;
Reference<OStoreDirectory_Impl> xDirectory (new OStoreDirectory_Impl());
if (!xDirectory.is())
2000-09-18 09:18:43 -05:00
return store_E_OutOfMemory;
OString aPath (pPath->buffer, pPath->length, RTL_TEXTENCODING_UTF8);
OString aName (pName->buffer, pName->length, RTL_TEXTENCODING_UTF8);
eErrCode = xDirectory->create (&*xManager, aPath.pData, aName.pData, eAccessMode);
2000-09-18 09:18:43 -05:00
if (eErrCode != store_E_None)
return eErrCode;
xDirectory->acquire();
*phDirectory = (storeDirectoryHandle)&(*xDirectory);
return store_E_None;
}
/*
* store_closeDirectory.
*/
storeError SAL_CALL store_closeDirectory (
storeDirectoryHandle Handle
) SAL_THROW_EXTERN_C()
2000-09-18 09:18:43 -05:00
{
OStoreDirectory_Impl *pDirectory =
OStoreHandle<OStoreDirectory_Impl>::query (Handle);
if (!pDirectory)
2000-09-18 09:18:43 -05:00
return store_E_InvalidHandle;
pDirectory->release();
2000-09-18 09:18:43 -05:00
return store_E_None;
}
/*
* store_findFirst.
*/
storeError SAL_CALL store_findFirst (
storeDirectoryHandle Handle,
storeFindData *pFindData
) SAL_THROW_EXTERN_C()
2000-09-18 09:18:43 -05:00
{
OStoreHandle<OStoreDirectory_Impl> xDirectory (
OStoreHandle<OStoreDirectory_Impl>::query (Handle));
if (!xDirectory.is())
2000-09-18 09:18:43 -05:00
return store_E_InvalidHandle;
if (!pFindData)
return store_E_InvalidParameter;
// Initialize FindData.
rtl_zeroMemory (pFindData, sizeof (storeFindData));
// Find first.
pFindData->m_nReserved = (sal_uInt32)(~0);
return xDirectory->iterate (*pFindData);
}
/*
* store_findNext.
*/
storeError SAL_CALL store_findNext (
storeDirectoryHandle Handle,
storeFindData *pFindData
) SAL_THROW_EXTERN_C()
2000-09-18 09:18:43 -05:00
{
OStoreHandle<OStoreDirectory_Impl> xDirectory (
OStoreHandle<OStoreDirectory_Impl>::query (Handle));
if (!xDirectory.is())
2000-09-18 09:18:43 -05:00
return store_E_InvalidHandle;
if (!pFindData)
return store_E_InvalidParameter;
// Check FindData.
if (!pFindData->m_nReserved)
return store_E_NoMoreFiles;
// Find next.
pFindData->m_nReserved -= 1;
return xDirectory->iterate (*pFindData);
}
/*========================================================================
*
* storeStreamHandle implementation.
*
*======================================================================*/
/*
* store_openStream
*/
storeError SAL_CALL store_openStream (
storeFileHandle hFile,
rtl_uString *pPath,
rtl_uString *pName,
storeAccessMode eAccessMode,
storeStreamHandle *phStream
) SAL_THROW_EXTERN_C()
2000-09-18 09:18:43 -05:00
{
storeError eErrCode = store_E_None;
if (phStream)
*phStream = NULL;
OStoreHandle<OStorePageManager> xManager (
OStoreHandle<OStorePageManager>::query (hFile));
if (!xManager.is())
2000-09-18 09:18:43 -05:00
return store_E_InvalidHandle;
if (!(pPath && pName && phStream))
return store_E_InvalidParameter;
Reference<OStoreLockBytes> xLockBytes (new OStoreLockBytes());
if (!xLockBytes.is())
2000-09-18 09:18:43 -05:00
return store_E_OutOfMemory;
OString aPath (pPath->buffer, pPath->length, RTL_TEXTENCODING_UTF8);
OString aName (pName->buffer, pName->length, RTL_TEXTENCODING_UTF8);
eErrCode = xLockBytes->create (&*xManager, aPath.pData, aName.pData, eAccessMode);
2000-09-18 09:18:43 -05:00
if (eErrCode != store_E_None)
return eErrCode;
xLockBytes->acquire();
*phStream = (storeStreamHandle)&(*xLockBytes);
return store_E_None;
}
/*
* store_closeStream.
*/
storeError SAL_CALL store_closeStream (
storeStreamHandle Handle
) SAL_THROW_EXTERN_C()
2000-09-18 09:18:43 -05:00
{
OStoreLockBytes *pLockBytes =
OStoreHandle<OStoreLockBytes>::query (Handle);
if (!pLockBytes)
2000-09-18 09:18:43 -05:00
return store_E_InvalidHandle;
pLockBytes->release();
2000-09-18 09:18:43 -05:00
return store_E_None;
}
/*
* store_readStream.
*/
storeError SAL_CALL store_readStream (
storeStreamHandle Handle,
sal_uInt32 nOffset,
void *pBuffer,
sal_uInt32 nBytes,
sal_uInt32 *pnDone
) SAL_THROW_EXTERN_C()
2000-09-18 09:18:43 -05:00
{
OStoreHandle<OStoreLockBytes> xLockBytes (
OStoreHandle<OStoreLockBytes>::query (Handle));
if (!xLockBytes.is())
2000-09-18 09:18:43 -05:00
return store_E_InvalidHandle;
if (!(pBuffer && pnDone))
return store_E_InvalidParameter;
return xLockBytes->readAt (nOffset, pBuffer, nBytes, *pnDone);
}
/*
* store_writeStream.
*/
storeError SAL_CALL store_writeStream (
storeStreamHandle Handle,
sal_uInt32 nOffset,
const void *pBuffer,
sal_uInt32 nBytes,
sal_uInt32 *pnDone
) SAL_THROW_EXTERN_C()
2000-09-18 09:18:43 -05:00
{
OStoreHandle<OStoreLockBytes> xLockBytes (
OStoreHandle<OStoreLockBytes>::query (Handle));
if (!xLockBytes.is())
2000-09-18 09:18:43 -05:00
return store_E_InvalidHandle;
if (!(pBuffer && pnDone))
return store_E_InvalidParameter;
return xLockBytes->writeAt (nOffset, pBuffer, nBytes, *pnDone);
}
/*
* store_flushStream.
*/
storeError SAL_CALL store_flushStream (
storeStreamHandle Handle
) SAL_THROW_EXTERN_C()
2000-09-18 09:18:43 -05:00
{
OStoreHandle<OStoreLockBytes> xLockBytes (
OStoreHandle<OStoreLockBytes>::query (Handle));
if (!xLockBytes.is())
2000-09-18 09:18:43 -05:00
return store_E_InvalidHandle;
return xLockBytes->flush();
}
/*
* store_getStreamSize.
*/
storeError SAL_CALL store_getStreamSize (
storeStreamHandle Handle,
sal_uInt32 *pnSize
) SAL_THROW_EXTERN_C()
2000-09-18 09:18:43 -05:00
{
OStoreHandle<OStoreLockBytes> xLockBytes (
OStoreHandle<OStoreLockBytes>::query (Handle));
if (!xLockBytes.is())
2000-09-18 09:18:43 -05:00
return store_E_InvalidHandle;
if (!pnSize)
return store_E_InvalidParameter;
return xLockBytes->stat (*pnSize);
}
/*
* store_setStreamSize.
*/
storeError SAL_CALL store_setStreamSize (
storeStreamHandle Handle,
sal_uInt32 nSize
) SAL_THROW_EXTERN_C()
2000-09-18 09:18:43 -05:00
{
OStoreHandle<OStoreLockBytes> xLockBytes (
OStoreHandle<OStoreLockBytes>::query (Handle));
if (!xLockBytes.is())
2000-09-18 09:18:43 -05:00
return store_E_InvalidHandle;
return xLockBytes->setSize (nSize);
}
/*========================================================================
*
* Common storeDirectoryHandle and storeStreamHandle operations.
*
*======================================================================*/
/*
* store_attrib.
*/
storeError SAL_CALL store_attrib (
storeFileHandle Handle,
rtl_uString *pPath,
rtl_uString *pName,
sal_uInt32 nMask1,
sal_uInt32 nMask2,
sal_uInt32 *pnAttrib
) SAL_THROW_EXTERN_C()
2000-09-18 09:18:43 -05:00
{
storeError eErrCode = store_E_None;
if (pnAttrib)
*pnAttrib = 0;
OStoreHandle<OStorePageManager> xManager (
OStoreHandle<OStorePageManager>::query (Handle));
if (!xManager.is())
2000-09-18 09:18:43 -05:00
return store_E_InvalidHandle;
if (!(pPath && pName))
return store_E_InvalidParameter;
// Setup page key.
OString aPath (pPath->buffer, pPath->length, RTL_TEXTENCODING_UTF8);
OString aName (pName->buffer, pName->length, RTL_TEXTENCODING_UTF8);
OStorePageKey aKey;
eErrCode = OStorePageManager::namei (aPath.pData, aName.pData, aKey);
2000-09-18 09:18:43 -05:00
if (eErrCode != store_E_None)
return eErrCode;
// Obtain or modify page attributes.
sal_uInt32 nAttrib = 0;
eErrCode = xManager->attrib (aKey, nMask1, nMask2, nAttrib);
if (pnAttrib)
*pnAttrib = nAttrib;
return eErrCode;
}
/*
* store_link.
*/
storeError SAL_CALL store_link (
storeFileHandle Handle,
rtl_uString *pSrcPath, rtl_uString *pSrcName,
rtl_uString *pDstPath, rtl_uString *pDstName
) SAL_THROW_EXTERN_C()
2000-09-18 09:18:43 -05:00
{
storeError eErrCode = store_E_None;
OStoreHandle<OStorePageManager> xManager (
OStoreHandle<OStorePageManager>::query (Handle));
if (!xManager.is())
2000-09-18 09:18:43 -05:00
return store_E_InvalidHandle;
if (!(pSrcPath && pSrcName))
return store_E_InvalidParameter;
if (!(pDstPath && pDstName))
return store_E_InvalidParameter;
// Setup 'Source' page key.
OString aSrcPath (
pSrcPath->buffer, pSrcPath->length, RTL_TEXTENCODING_UTF8);
OString aSrcName (
pSrcName->buffer, pSrcName->length, RTL_TEXTENCODING_UTF8);
OStorePageKey aSrcKey;
eErrCode = OStorePageManager::namei (
2000-09-18 09:18:43 -05:00
aSrcPath.pData, aSrcName.pData, aSrcKey);
if (eErrCode != store_E_None)
return eErrCode;
// Setup 'Destination' page key.
OString aDstPath (
pDstPath->buffer, pDstPath->length, RTL_TEXTENCODING_UTF8);
OString aDstName (
pDstName->buffer, pDstName->length, RTL_TEXTENCODING_UTF8);
OStorePageKey aDstKey;
eErrCode = OStorePageManager::namei (
2000-09-18 09:18:43 -05:00
aDstPath.pData, aDstName.pData, aDstKey);
if (eErrCode != store_E_None)
return eErrCode;
// Link 'Source' hard to 'Destination'.
return xManager->link (aSrcKey, aDstKey);
}
/*
* store_symlink.
*/
storeError SAL_CALL store_symlink (
storeFileHandle Handle,
rtl_uString *pSrcPath, rtl_uString *pSrcName,
rtl_uString *pDstPath, rtl_uString *pDstName
) SAL_THROW_EXTERN_C()
2000-09-18 09:18:43 -05:00
{
storeError eErrCode = store_E_None;
OStoreHandle<OStorePageManager> xManager (
OStoreHandle<OStorePageManager>::query (Handle));
if (!xManager.is())
2000-09-18 09:18:43 -05:00
return store_E_InvalidHandle;
if (!(pSrcPath && pSrcName))
return store_E_InvalidParameter;
if (!(pDstPath && pDstName))
return store_E_InvalidParameter;
// Setup 'Destination' page key.
OString aDstPath (
pDstPath->buffer, pDstPath->length, RTL_TEXTENCODING_UTF8);
OString aDstName (
pDstName->buffer, pDstName->length, RTL_TEXTENCODING_UTF8);
OStorePageKey aDstKey;
eErrCode = OStorePageManager::namei (
2000-09-18 09:18:43 -05:00
aDstPath.pData, aDstName.pData, aDstKey);
if (eErrCode != store_E_None)
return eErrCode;
// Insert 'Source' as symlink to 'Destination'.
OString aSrcPath (
pSrcPath->buffer, pSrcPath->length, RTL_TEXTENCODING_UTF8);
OString aSrcName (
pSrcName->buffer, pSrcName->length, RTL_TEXTENCODING_UTF8);
return xManager->symlink (aSrcPath.pData, aSrcName.pData, aDstKey);
}
/*
* store_rename.
*/
storeError SAL_CALL store_rename (
storeFileHandle Handle,
rtl_uString *pSrcPath, rtl_uString *pSrcName,
rtl_uString *pDstPath, rtl_uString *pDstName
) SAL_THROW_EXTERN_C()
2000-09-18 09:18:43 -05:00
{
storeError eErrCode = store_E_None;
OStoreHandle<OStorePageManager> xManager (
OStoreHandle<OStorePageManager>::query (Handle));
if (!xManager.is())
2000-09-18 09:18:43 -05:00
return store_E_InvalidHandle;
if (!(pSrcPath && pSrcName))
return store_E_InvalidParameter;
if (!(pDstPath && pDstName))
return store_E_InvalidParameter;
// Setup 'Source' page key.
OString aSrcPath (
pSrcPath->buffer, pSrcPath->length, RTL_TEXTENCODING_UTF8);
OString aSrcName (
pSrcName->buffer, pSrcName->length, RTL_TEXTENCODING_UTF8);
OStorePageKey aSrcKey;
eErrCode = OStorePageManager::namei (
2000-09-18 09:18:43 -05:00
aSrcPath.pData, aSrcName.pData, aSrcKey);
if (eErrCode != store_E_None)
return eErrCode;
// Rename 'Source' into 'Destination'.
OString aDstPath (
pDstPath->buffer, pDstPath->length, RTL_TEXTENCODING_UTF8);
OString aDstName (
pDstName->buffer, pDstName->length, RTL_TEXTENCODING_UTF8);
return xManager->rename (aSrcKey, aDstPath.pData, aDstName.pData);
}
/*
* store_remove.
*/
storeError SAL_CALL store_remove (
storeFileHandle Handle,
rtl_uString *pPath,
rtl_uString *pName
) SAL_THROW_EXTERN_C()
2000-09-18 09:18:43 -05:00
{
storeError eErrCode = store_E_None;
OStoreHandle<OStorePageManager> xManager (
OStoreHandle<OStorePageManager>::query (Handle));
if (!xManager.is())
2000-09-18 09:18:43 -05:00
return store_E_InvalidHandle;
if (!(pPath && pName))
return store_E_InvalidParameter;
// Setup page key.
OString aPath (pPath->buffer, pPath->length, RTL_TEXTENCODING_UTF8);
OString aName (pName->buffer, pName->length, RTL_TEXTENCODING_UTF8);
OStorePageKey aKey;
eErrCode = OStorePageManager::namei (aPath.pData, aName.pData, aKey);
2000-09-18 09:18:43 -05:00
if (eErrCode != store_E_None)
return eErrCode;
// Remove.
return xManager->remove (aKey);
}