Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef _STORE_STORDIR_HXX_
21 : #define _STORE_STORDIR_HXX_
22 :
23 : #include <sal/types.h>
24 :
25 : #include <rtl/textcvt.h>
26 : #include <rtl/string.h>
27 : #include <rtl/ref.hxx>
28 :
29 : #include "object.hxx"
30 : #include "storbase.hxx"
31 : #include "storpage.hxx"
32 :
33 : namespace store
34 : {
35 :
36 : struct OStoreDirectoryPageData;
37 :
38 : /*========================================================================
39 : *
40 : * OStoreDirectory_Impl interface.
41 : *
42 : *======================================================================*/
43 : class OStoreDirectory_Impl : public store::OStoreObject
44 : {
45 : public:
46 : /** Construction.
47 : */
48 : OStoreDirectory_Impl (void);
49 :
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.
56 : */
57 : storeError create (
58 : OStorePageManager *pManager,
59 : rtl_String *pPath,
60 : rtl_String *pName,
61 : storeAccessMode eAccessMode);
62 :
63 : /** iterate.
64 : * @param rFindData [out]
65 : * @return store_E_None upon success,
66 : * store_E_NoMoreFiles upon end of iteration.
67 : */
68 : storeError iterate (
69 : storeFindData &rFindData);
70 :
71 : /** IStoreHandle.
72 : */
73 : virtual bool isKindOf (sal_uInt32 nTypeId) SAL_OVERRIDE;
74 :
75 : protected:
76 : /** Destruction.
77 : */
78 : virtual ~OStoreDirectory_Impl (void);
79 :
80 : private:
81 : /** IStoreHandle TypeId.
82 : */
83 : static const sal_uInt32 m_nTypeId;
84 :
85 : /** IStoreHandle query() template function specialization.
86 : */
87 : friend OStoreDirectory_Impl*
88 : SAL_CALL query<> (IStoreHandle *pHandle, OStoreDirectory_Impl*);
89 :
90 : /** Representation.
91 : */
92 : typedef OStoreDirectoryPageData inode;
93 : typedef PageHolderObject< inode > inode_holder_type;
94 :
95 : rtl::Reference<OStorePageManager> m_xManager;
96 :
97 : OStorePageDescriptor m_aDescr;
98 : sal_uInt32 m_nPath;
99 : rtl_TextToUnicodeConverter m_hTextCvt;
100 :
101 : /** Not implemented.
102 : */
103 : OStoreDirectory_Impl (const OStoreDirectory_Impl&);
104 : OStoreDirectory_Impl& operator= (const OStoreDirectory_Impl&);
105 : };
106 :
107 : template<> inline OStoreDirectory_Impl*
108 0 : SAL_CALL query (IStoreHandle *pHandle, SAL_UNUSED_PARAMETER OStoreDirectory_Impl*)
109 : {
110 0 : if (pHandle && pHandle->isKindOf (OStoreDirectory_Impl::m_nTypeId))
111 : {
112 : // Handle is kind of OStoreDirectory_Impl.
113 0 : return static_cast<OStoreDirectory_Impl*>(pHandle);
114 : }
115 0 : return 0;
116 : }
117 :
118 : /*========================================================================
119 : *
120 : * The End.
121 : *
122 : *======================================================================*/
123 :
124 : } // namespace store
125 :
126 : #endif /* !_STORE_STORDIR_HXX_ */
127 :
128 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|