nss: upgrade to release 3.73
[LibreOffice.git] / store / source / stordir.hxx
blobf9845bc295eb74a7a03f69cc84b4477fa947d4e1
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"
32 namespace store
35 class OStorePageManager;
36 struct OStoreDirectoryPageData;
38 class OStoreDirectory_Impl : public store::OStoreObject
40 public:
41 /** Construction.
43 OStoreDirectory_Impl();
45 /** create (two-phase construction).
46 * @param pManager [in]
47 * @param pPath [in]
48 * @param pName [in]
49 * @param eAccessMode [in]
50 * @return store_E_None upon success.
52 storeError create (
53 OStorePageManager *pManager,
54 rtl_String const *pPath,
55 rtl_String const *pName,
56 storeAccessMode eAccessMode);
58 /** iterate.
59 * @param rFindData [out]
60 * @return store_E_None upon success,
61 * store_E_NoMoreFiles upon end of iteration.
63 storeError iterate (
64 storeFindData &rFindData);
66 /** IStoreHandle.
68 virtual bool isKindOf (sal_uInt32 nTypeId) override;
70 protected:
71 /** Destruction.
73 virtual ~OStoreDirectory_Impl() override;
75 private:
76 /** IStoreHandle TypeId.
78 static const sal_uInt32 m_nTypeId;
80 /** IStoreHandle query() template function specialization.
82 friend OStoreDirectory_Impl*
83 SAL_CALL query<> (OStoreObject *pHandle, OStoreDirectory_Impl*);
85 /** Representation.
87 typedef OStoreDirectoryPageData inode;
88 typedef PageHolderObject< inode > inode_holder_type;
90 rtl::Reference<OStorePageManager> m_xManager;
92 OStorePageDescriptor m_aDescr;
93 sal_uInt32 m_nPath;
94 rtl_TextToUnicodeConverter m_hTextCvt;
96 OStoreDirectory_Impl (const OStoreDirectory_Impl&) = delete;
97 OStoreDirectory_Impl& operator= (const OStoreDirectory_Impl&) = delete;
100 template<> inline OStoreDirectory_Impl*
101 SAL_CALL query (OStoreObject *pHandle, SAL_UNUSED_PARAMETER OStoreDirectory_Impl*)
103 if (pHandle && pHandle->isKindOf (OStoreDirectory_Impl::m_nTypeId))
105 // Handle is kind of OStoreDirectory_Impl.
106 return static_cast<OStoreDirectory_Impl*>(pHandle);
108 return nullptr;
111 } // namespace store
113 #endif // INCLUDED_STORE_SOURCE_STORDIR_HXX
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */