Branch libreoffice-5-0-4
[LibreOffice.git] / store / source / stordir.hxx
blob8fb9de74798e51b0203406ccbf14ab01a59cc015
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_STORDIR_HXX
21 #define INCLUDED_STORE_SOURCE_STORDIR_HXX
23 #include <sal/types.h>
25 #include <rtl/textcvt.h>
26 #include <rtl/string.h>
27 #include <rtl/ref.hxx>
29 #include "object.hxx"
30 #include "storbase.hxx"
31 #include "storpage.hxx"
33 namespace store
36 struct OStoreDirectoryPageData;
38 /*========================================================================
40 * OStoreDirectory_Impl interface.
42 *======================================================================*/
43 class OStoreDirectory_Impl : public store::OStoreObject
45 public:
46 /** Construction.
48 OStoreDirectory_Impl();
50 /** create (two-phase construction).
51 * @param pManager [in]
52 * @param pPath [in]
53 * @param pName [in]
54 * @param eAccessMode [in]
55 * @return store_E_None upon success.
57 storeError create (
58 OStorePageManager *pManager,
59 rtl_String *pPath,
60 rtl_String *pName,
61 storeAccessMode eAccessMode);
63 /** iterate.
64 * @param rFindData [out]
65 * @return store_E_None upon success,
66 * store_E_NoMoreFiles upon end of iteration.
68 storeError iterate (
69 storeFindData &rFindData);
71 /** IStoreHandle.
73 virtual bool isKindOf (sal_uInt32 nTypeId) SAL_OVERRIDE;
75 protected:
76 /** Destruction.
78 virtual ~OStoreDirectory_Impl();
80 private:
81 /** IStoreHandle TypeId.
83 static const sal_uInt32 m_nTypeId;
85 /** IStoreHandle query() template function specialization.
87 friend OStoreDirectory_Impl*
88 SAL_CALL query<> (IStoreHandle *pHandle, OStoreDirectory_Impl*);
90 /** Representation.
92 typedef OStoreDirectoryPageData inode;
93 typedef PageHolderObject< inode > inode_holder_type;
95 rtl::Reference<OStorePageManager> m_xManager;
97 OStorePageDescriptor m_aDescr;
98 sal_uInt32 m_nPath;
99 rtl_TextToUnicodeConverter m_hTextCvt;
101 OStoreDirectory_Impl (const OStoreDirectory_Impl&) SAL_DELETED_FUNCTION;
102 OStoreDirectory_Impl& operator= (const OStoreDirectory_Impl&) SAL_DELETED_FUNCTION;
105 template<> inline OStoreDirectory_Impl*
106 SAL_CALL query (IStoreHandle *pHandle, SAL_UNUSED_PARAMETER OStoreDirectory_Impl*)
108 if (pHandle && pHandle->isKindOf (OStoreDirectory_Impl::m_nTypeId))
110 // Handle is kind of OStoreDirectory_Impl.
111 return static_cast<OStoreDirectory_Impl*>(pHandle);
113 return 0;
116 /*========================================================================
118 * The End.
120 *======================================================================*/
122 } // namespace store
124 #endif // INCLUDED_STORE_SOURCE_STORDIR_HXX
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */