1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef _STORE_LOCKBYTE_HXX_
30 #define _STORE_LOCKBYTE_HXX_
32 #include "sal/types.h"
34 #include "rtl/ref.hxx"
35 #include "rtl/ustring.h"
37 #include "store/types.h"
38 #include "storbase.hxx"
43 /*========================================================================
45 * ILockBytes interface.
47 *======================================================================*/
48 class ILockBytes
: public rtl::IReference
52 @param rxAllocator [out]
55 storeError
initialize (
56 rtl::Reference
< PageData::Allocator
> & rxAllocator
,
57 sal_uInt16 nPageSize
);
63 storeError
readPageAt (
71 storeError
writePageAt (
72 PageHolder
const & rPage
,
79 @return store_E_None upon success
90 @return store_E_None upon success
99 @return store_E_None upon success
101 storeError
getSize (sal_uInt32
& rnSize
);
105 @return store_E_None upon success
107 storeError
setSize (sal_uInt32 nSize
);
110 @return store_E_None upon success
118 /** Implementation (abstract).
120 virtual storeError
initialize_Impl (
121 rtl::Reference
< PageData::Allocator
> & rxAllocator
,
122 sal_uInt16 nPageSize
) = 0;
124 virtual storeError
readPageAt_Impl (
126 sal_uInt32 nOffset
) = 0;
128 virtual storeError
writePageAt_Impl (
129 PageHolder
const & rPage
,
130 sal_uInt32 nOffset
) = 0;
132 virtual storeError
readAt_Impl (
135 sal_uInt32 nBytes
) = 0;
137 virtual storeError
writeAt_Impl (
140 sal_uInt32 nBytes
) = 0;
142 virtual storeError
getSize_Impl (
143 sal_uInt32
& rnSize
) = 0;
145 virtual storeError
setSize_Impl (
146 sal_uInt32 nSize
) = 0;
148 virtual storeError
flush_Impl() = 0;
151 /*========================================================================
153 * ILockBytes factories.
155 *======================================================================*/
158 FileLockBytes_createInstance (
159 rtl::Reference
< store::ILockBytes
> & rxLockBytes
,
160 rtl_uString
* pFilename
,
161 storeAccessMode eAccessMode
165 MemoryLockBytes_createInstance (
166 rtl::Reference
< store::ILockBytes
> & rxLockBytes
169 /*========================================================================
173 *======================================================================*/
177 #endif /* !_STORE_LOCKBYTE_HXX_ */
179 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */