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 .
22 #include <sal/types.h>
24 #include <rtl/string.h>
25 #include <rtl/ref.hxx>
28 #include "storbase.hxx"
33 class OStorePageManager
;
34 struct OStoreDataPageData
;
35 struct OStoreDirectoryPageData
;
37 class OStoreLockBytes
: public store::OStoreObject
42 /** create (two-phase construction).
43 * @param pManager [in]
47 * @return store_E_None upon success
50 OStorePageManager
*pManager
,
51 rtl_String
const *pPath
,
52 rtl_String
const *pName
,
53 storeAccessMode eAccessMode
);
55 /** Read at Offset into Buffer.
57 * @param pBuffer [out]
60 * @return store_E_None upon success
68 /** Write at Offset from Buffer.
73 * @return store_E_None upon success
83 * @return store_E_None upon success
85 storeError
setSize (sal_uInt32 nSize
);
89 virtual bool isKindOf (sal_uInt32 nMagic
) override
;
92 virtual ~OStoreLockBytes() override
;
95 /** IStoreHandle TypeId.
97 static const sal_uInt32 m_nTypeId
;
99 /** IStoreHandle query() template specialization.
101 friend OStoreLockBytes
*
102 SAL_CALL query
<> (OStoreObject
*pHandle
, OStoreLockBytes
*);
104 rtl::Reference
<OStorePageManager
> m_xManager
;
106 typedef OStoreDataPageData data
;
107 typedef OStoreDirectoryPageData inode
;
109 typedef PageHolderObject
< inode
> inode_holder_type
;
110 inode_holder_type m_xNode
;
114 OStoreLockBytes (const OStoreLockBytes
&) = delete;
115 OStoreLockBytes
& operator= (const OStoreLockBytes
&) = delete;
118 template<> inline OStoreLockBytes
*
119 SAL_CALL
query (OStoreObject
*pHandle
, SAL_UNUSED_PARAMETER OStoreLockBytes
*)
121 if (pHandle
&& pHandle
->isKindOf (OStoreLockBytes::m_nTypeId
))
123 // Handle is kind of OStoreLockBytes.
124 return static_cast<OStoreLockBytes
*>(pHandle
);
131 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */