1*b1cdbd2cSJim Jagielski /**************************************************************
2*b1cdbd2cSJim Jagielski *
3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one
4*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file
5*b1cdbd2cSJim Jagielski * distributed with this work for additional information
6*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file
7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the
8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance
9*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at
10*b1cdbd2cSJim Jagielski *
11*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0
12*b1cdbd2cSJim Jagielski *
13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing,
14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an
15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the
17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations
18*b1cdbd2cSJim Jagielski * under the License.
19*b1cdbd2cSJim Jagielski *
20*b1cdbd2cSJim Jagielski *************************************************************/
21*b1cdbd2cSJim Jagielski
22*b1cdbd2cSJim Jagielski
23*b1cdbd2cSJim Jagielski
24*b1cdbd2cSJim Jagielski #ifndef _STORE_STORDIR_HXX_
25*b1cdbd2cSJim Jagielski #define _STORE_STORDIR_HXX_
26*b1cdbd2cSJim Jagielski
27*b1cdbd2cSJim Jagielski #ifndef _SAL_TYPES_H_
28*b1cdbd2cSJim Jagielski #include <sal/types.h>
29*b1cdbd2cSJim Jagielski #endif
30*b1cdbd2cSJim Jagielski
31*b1cdbd2cSJim Jagielski #ifndef _RTL_TEXTCVT_H_
32*b1cdbd2cSJim Jagielski #include <rtl/textcvt.h>
33*b1cdbd2cSJim Jagielski #endif
34*b1cdbd2cSJim Jagielski #ifndef _RTL_STRING_H_
35*b1cdbd2cSJim Jagielski #include <rtl/string.h>
36*b1cdbd2cSJim Jagielski #endif
37*b1cdbd2cSJim Jagielski #ifndef _RTL_REF_HXX_
38*b1cdbd2cSJim Jagielski #include <rtl/ref.hxx>
39*b1cdbd2cSJim Jagielski #endif
40*b1cdbd2cSJim Jagielski
41*b1cdbd2cSJim Jagielski #ifndef _STORE_OBJECT_HXX_
42*b1cdbd2cSJim Jagielski #include "object.hxx"
43*b1cdbd2cSJim Jagielski #endif
44*b1cdbd2cSJim Jagielski #ifndef _STORE_STORBASE_HXX_
45*b1cdbd2cSJim Jagielski #include "storbase.hxx"
46*b1cdbd2cSJim Jagielski #endif
47*b1cdbd2cSJim Jagielski #ifndef _STORE_STORPAGE_HXX_
48*b1cdbd2cSJim Jagielski #include "storpage.hxx"
49*b1cdbd2cSJim Jagielski #endif
50*b1cdbd2cSJim Jagielski
51*b1cdbd2cSJim Jagielski namespace store
52*b1cdbd2cSJim Jagielski {
53*b1cdbd2cSJim Jagielski
54*b1cdbd2cSJim Jagielski struct OStoreDirectoryPageData;
55*b1cdbd2cSJim Jagielski
56*b1cdbd2cSJim Jagielski /*========================================================================
57*b1cdbd2cSJim Jagielski *
58*b1cdbd2cSJim Jagielski * OStoreDirectory_Impl interface.
59*b1cdbd2cSJim Jagielski *
60*b1cdbd2cSJim Jagielski *======================================================================*/
61*b1cdbd2cSJim Jagielski class OStoreDirectory_Impl : public store::OStoreObject
62*b1cdbd2cSJim Jagielski {
63*b1cdbd2cSJim Jagielski public:
64*b1cdbd2cSJim Jagielski /** Construction.
65*b1cdbd2cSJim Jagielski */
66*b1cdbd2cSJim Jagielski OStoreDirectory_Impl (void);
67*b1cdbd2cSJim Jagielski
68*b1cdbd2cSJim Jagielski /** create (two-phase construction).
69*b1cdbd2cSJim Jagielski * @param pManager [in]
70*b1cdbd2cSJim Jagielski * @param pPath [in]
71*b1cdbd2cSJim Jagielski * @param pName [in]
72*b1cdbd2cSJim Jagielski * @param eAccessMode [in]
73*b1cdbd2cSJim Jagielski * @return store_E_None upon success.
74*b1cdbd2cSJim Jagielski */
75*b1cdbd2cSJim Jagielski storeError create (
76*b1cdbd2cSJim Jagielski OStorePageManager *pManager,
77*b1cdbd2cSJim Jagielski rtl_String *pPath,
78*b1cdbd2cSJim Jagielski rtl_String *pName,
79*b1cdbd2cSJim Jagielski storeAccessMode eAccessMode);
80*b1cdbd2cSJim Jagielski
81*b1cdbd2cSJim Jagielski /** iterate.
82*b1cdbd2cSJim Jagielski * @param rFindData [out]
83*b1cdbd2cSJim Jagielski * @return store_E_None upon success,
84*b1cdbd2cSJim Jagielski * store_E_NoMoreFiles upon end of iteration.
85*b1cdbd2cSJim Jagielski */
86*b1cdbd2cSJim Jagielski storeError iterate (
87*b1cdbd2cSJim Jagielski storeFindData &rFindData);
88*b1cdbd2cSJim Jagielski
89*b1cdbd2cSJim Jagielski /** IStoreHandle.
90*b1cdbd2cSJim Jagielski */
91*b1cdbd2cSJim Jagielski virtual sal_Bool SAL_CALL isKindOf (sal_uInt32 nTypeId);
92*b1cdbd2cSJim Jagielski
93*b1cdbd2cSJim Jagielski protected:
94*b1cdbd2cSJim Jagielski /** Destruction.
95*b1cdbd2cSJim Jagielski */
96*b1cdbd2cSJim Jagielski virtual ~OStoreDirectory_Impl (void);
97*b1cdbd2cSJim Jagielski
98*b1cdbd2cSJim Jagielski private:
99*b1cdbd2cSJim Jagielski /** IStoreHandle TypeId.
100*b1cdbd2cSJim Jagielski */
101*b1cdbd2cSJim Jagielski static const sal_uInt32 m_nTypeId;
102*b1cdbd2cSJim Jagielski
103*b1cdbd2cSJim Jagielski /** IStoreHandle query() template function specialization.
104*b1cdbd2cSJim Jagielski */
105*b1cdbd2cSJim Jagielski friend OStoreDirectory_Impl*
106*b1cdbd2cSJim Jagielski SAL_CALL query<> (IStoreHandle *pHandle, OStoreDirectory_Impl*);
107*b1cdbd2cSJim Jagielski
108*b1cdbd2cSJim Jagielski /** Representation.
109*b1cdbd2cSJim Jagielski */
110*b1cdbd2cSJim Jagielski typedef OStoreDirectoryPageData inode;
111*b1cdbd2cSJim Jagielski typedef PageHolderObject< inode > inode_holder_type;
112*b1cdbd2cSJim Jagielski
113*b1cdbd2cSJim Jagielski rtl::Reference<OStorePageManager> m_xManager;
114*b1cdbd2cSJim Jagielski
115*b1cdbd2cSJim Jagielski OStorePageDescriptor m_aDescr;
116*b1cdbd2cSJim Jagielski sal_uInt32 m_nPath;
117*b1cdbd2cSJim Jagielski rtl_TextToUnicodeConverter m_hTextCvt;
118*b1cdbd2cSJim Jagielski
119*b1cdbd2cSJim Jagielski /** Not implemented.
120*b1cdbd2cSJim Jagielski */
121*b1cdbd2cSJim Jagielski OStoreDirectory_Impl (const OStoreDirectory_Impl&);
122*b1cdbd2cSJim Jagielski OStoreDirectory_Impl& operator= (const OStoreDirectory_Impl&);
123*b1cdbd2cSJim Jagielski };
124*b1cdbd2cSJim Jagielski
125*b1cdbd2cSJim Jagielski template<> inline OStoreDirectory_Impl*
query(IStoreHandle * pHandle,OStoreDirectory_Impl *)126*b1cdbd2cSJim Jagielski SAL_CALL query (IStoreHandle *pHandle, OStoreDirectory_Impl*)
127*b1cdbd2cSJim Jagielski {
128*b1cdbd2cSJim Jagielski if (pHandle && pHandle->isKindOf (OStoreDirectory_Impl::m_nTypeId))
129*b1cdbd2cSJim Jagielski {
130*b1cdbd2cSJim Jagielski // Handle is kind of OStoreDirectory_Impl.
131*b1cdbd2cSJim Jagielski return static_cast<OStoreDirectory_Impl*>(pHandle);
132*b1cdbd2cSJim Jagielski }
133*b1cdbd2cSJim Jagielski return 0;
134*b1cdbd2cSJim Jagielski }
135*b1cdbd2cSJim Jagielski
136*b1cdbd2cSJim Jagielski /*========================================================================
137*b1cdbd2cSJim Jagielski *
138*b1cdbd2cSJim Jagielski * The End.
139*b1cdbd2cSJim Jagielski *
140*b1cdbd2cSJim Jagielski *======================================================================*/
141*b1cdbd2cSJim Jagielski
142*b1cdbd2cSJim Jagielski } // namespace store
143*b1cdbd2cSJim Jagielski
144*b1cdbd2cSJim Jagielski #endif /* !_STORE_STORDIR_HXX_ */
145*b1cdbd2cSJim Jagielski
146