1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_STORE_SOURCE_STORLCKB_HXX
21 #define INCLUDED_STORE_SOURCE_STORLCKB_HXX
23 #include "sal/types.h"
25 #include "rtl/ustring.h"
26 #include "rtl/ref.hxx"
29 #include "storbase.hxx"
30 #include "storpage.hxx"
35 struct OStoreDataPageData
;
36 struct OStoreDirectoryPageData
;
38 /*========================================================================
40 * OStoreLockBytes interface.
42 *======================================================================*/
43 class OStoreLockBytes
: public store::OStoreObject
50 /** create (two-phase construction).
51 * @param pManager [in]
55 * @return store_E_None upon success
58 OStorePageManager
*pManager
,
61 storeAccessMode eAccessMode
);
63 /** Read at Offset into Buffer.
65 * @param pBuffer [out]
68 * @return store_E_None upon success
76 /** Write at Offset from Buffer.
81 * @return store_E_None upon success
90 * @return store_E_None upon success
96 * @return store_E_None upon success
98 storeError
setSize (sal_uInt32 nSize
);
101 * @paran rnSize [out]
102 * @return store_E_None upon success
104 storeError
stat (sal_uInt32
&rnSize
);
108 virtual bool isKindOf (sal_uInt32 nMagic
) SAL_OVERRIDE
;
111 /** Destruction (OReference).
113 virtual ~OStoreLockBytes();
116 /** IStoreHandle TypeId.
118 static const sal_uInt32 m_nTypeId
;
120 /** IStoreHandle query() template specialization.
122 friend OStoreLockBytes
*
123 SAL_CALL query
<> (IStoreHandle
*pHandle
, OStoreLockBytes
*);
127 rtl::Reference
<OStorePageManager
> m_xManager
;
129 typedef OStoreDataPageData data
;
130 typedef OStoreDirectoryPageData inode
;
132 typedef PageHolderObject
< inode
> inode_holder_type
;
133 inode_holder_type m_xNode
;
137 OStoreLockBytes (const OStoreLockBytes
&) SAL_DELETED_FUNCTION
;
138 OStoreLockBytes
& operator= (const OStoreLockBytes
&) SAL_DELETED_FUNCTION
;
141 template<> inline OStoreLockBytes
*
142 SAL_CALL
query (IStoreHandle
*pHandle
, SAL_UNUSED_PARAMETER OStoreLockBytes
*)
144 if (pHandle
&& pHandle
->isKindOf (OStoreLockBytes::m_nTypeId
))
146 // Handle is kind of OStoreLockBytes.
147 return static_cast<OStoreLockBytes
*>(pHandle
);
152 /*========================================================================
156 *======================================================================*/
160 #endif // INCLUDED_STORE_SOURCE_STORLCKB_HXX
162 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */