Version 3.6.0.4, tag libreoffice-3.6.0.4
[LibreOffice.git] / store / source / stordir.hxx
blobe2ef5bc4caf0e772882017ee7f76c0054899fc42
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef _STORE_STORDIR_HXX_
30 #define _STORE_STORDIR_HXX_
32 #include <sal/types.h>
34 #include <rtl/textcvt.h>
35 #include <rtl/string.h>
36 #include <rtl/ref.hxx>
38 #include "object.hxx"
39 #include "storbase.hxx"
40 #include "storpage.hxx"
42 namespace store
45 struct OStoreDirectoryPageData;
47 /*========================================================================
49 * OStoreDirectory_Impl interface.
51 *======================================================================*/
52 class OStoreDirectory_Impl : public store::OStoreObject
54 public:
55 /** Construction.
57 OStoreDirectory_Impl (void);
59 /** create (two-phase construction).
60 * @param pManager [in]
61 * @param pPath [in]
62 * @param pName [in]
63 * @param eAccessMode [in]
64 * @return store_E_None upon success.
66 storeError create (
67 OStorePageManager *pManager,
68 rtl_String *pPath,
69 rtl_String *pName,
70 storeAccessMode eAccessMode);
72 /** iterate.
73 * @param rFindData [out]
74 * @return store_E_None upon success,
75 * store_E_NoMoreFiles upon end of iteration.
77 storeError iterate (
78 storeFindData &rFindData);
80 /** IStoreHandle.
82 virtual sal_Bool SAL_CALL isKindOf (sal_uInt32 nTypeId);
84 protected:
85 /** Destruction.
87 virtual ~OStoreDirectory_Impl (void);
89 private:
90 /** IStoreHandle TypeId.
92 static const sal_uInt32 m_nTypeId;
94 /** IStoreHandle query() template function specialization.
96 friend OStoreDirectory_Impl*
97 SAL_CALL query<> (IStoreHandle *pHandle, OStoreDirectory_Impl*);
99 /** Representation.
101 typedef OStoreDirectoryPageData inode;
102 typedef PageHolderObject< inode > inode_holder_type;
104 rtl::Reference<OStorePageManager> m_xManager;
106 OStorePageDescriptor m_aDescr;
107 sal_uInt32 m_nPath;
108 rtl_TextToUnicodeConverter m_hTextCvt;
110 /** Not implemented.
112 OStoreDirectory_Impl (const OStoreDirectory_Impl&);
113 OStoreDirectory_Impl& operator= (const OStoreDirectory_Impl&);
116 template<> inline OStoreDirectory_Impl*
117 SAL_CALL query (IStoreHandle *pHandle, SAL_UNUSED_PARAMETER OStoreDirectory_Impl*)
119 if (pHandle && pHandle->isKindOf (OStoreDirectory_Impl::m_nTypeId))
121 // Handle is kind of OStoreDirectory_Impl.
122 return static_cast<OStoreDirectory_Impl*>(pHandle);
124 return 0;
127 /*========================================================================
129 * The End.
131 *======================================================================*/
133 } // namespace store
135 #endif /* !_STORE_STORDIR_HXX_ */
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */