diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-03-01 23:23:50 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-03-01 23:23:50 +0100 |
commit | 12353c73868d26690aa4ac008ef5e9f2db8bc12c (patch) | |
tree | 5dc83b1d377e9b51c5af215e94b2ed9777cf762a /unoidl/inc | |
parent | 866ebf66b3a50b2d601825e4533898949d5b86c8 (diff) |
WIP: Experimental new binary type.rdb format
Add LegacyProvider to read the old format (requires a provider Manager, to
resolve singletons' bases, to decide whether they are interface- or service-
based).
Replace registry-based reg2bin with provider-based reg2unoidl.
Change-Id: I5865e62308cc2d9c5439211ac803d84e93aab656
Diffstat (limited to 'unoidl/inc')
-rw-r--r-- | unoidl/inc/unoidl/legacyprovider.hxx | 49 | ||||
-rw-r--r-- | unoidl/inc/unoidl/unoidl.hxx | 21 | ||||
-rw-r--r-- | unoidl/inc/unoidl/unoidlprovider.hxx | 4 |
3 files changed, 73 insertions, 1 deletions
diff --git a/unoidl/inc/unoidl/legacyprovider.hxx b/unoidl/inc/unoidl/legacyprovider.hxx new file mode 100644 index 000000000000..68db79c933c2 --- /dev/null +++ b/unoidl/inc/unoidl/legacyprovider.hxx @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_UNOIDL_LEGACYPROVIDER_HXX +#define INCLUDED_UNOIDL_LEGACYPROVIDER_HXX + +#include "sal/config.h" + +#include "registry/registry.hxx" +#include "rtl/ref.hxx" +#include "sal/types.h" +#include "unoidl/detail/dllapi.hxx" +#include "unoidl/unoidl.hxx" + +namespace rtl { class OUString; } + +namespace unoidl { + +class LO_DLLPUBLIC_UNOIDL LegacyProvider: public Provider { +public: + // throws FileFormatException, NoSuchFileException: + LegacyProvider( + rtl::Reference< Manager > const & manager, rtl::OUString const & uri); + + // throws FileFormatException: + virtual rtl::Reference< MapCursor > createRootCursor() const; + + // throws FileFormatException: + virtual rtl::Reference< Entity > findEntity(rtl::OUString const & name) + const; + +private: + virtual SAL_DLLPRIVATE ~LegacyProvider() throw (); + + rtl::Reference< Manager > manager_; + mutable RegistryKey ucr_; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unoidl/inc/unoidl/unoidl.hxx b/unoidl/inc/unoidl/unoidl.hxx index 372ed3889ade..5597227c16e0 100644 --- a/unoidl/inc/unoidl/unoidl.hxx +++ b/unoidl/inc/unoidl/unoidl.hxx @@ -601,15 +601,34 @@ public: // throws FileFormatException: virtual rtl::Reference< MapCursor > createRootCursor() const = 0; + // throws FileFormatException: + virtual rtl::Reference< Entity > findEntity(rtl::OUString const & name) + const = 0; + protected: SAL_DLLPRIVATE Provider() {} virtual SAL_DLLPRIVATE ~Provider() throw (); }; +class LO_DLLPUBLIC_UNOIDL Manager: public salhelper::SimpleReferenceObject { +public: + Manager() {} + + void addProvider(rtl::Reference< Provider > const & provider); + + // throws FileFormatException: + rtl::Reference< Entity > findEntity(rtl::OUString const & name) const; + +private: + virtual SAL_DLLPRIVATE ~Manager() throw (); + + std::vector< rtl::Reference< Provider > > providers_; +}; + // throws FileFormatException, NoSuchFileException: LO_DLLPUBLIC_UNOIDL rtl::Reference< Provider > loadProvider( - rtl::OUString const & uri); + rtl::Reference< Manager > const & manager, rtl::OUString const & uri); } diff --git a/unoidl/inc/unoidl/unoidlprovider.hxx b/unoidl/inc/unoidl/unoidlprovider.hxx index 07388a604034..b72a629990ef 100644 --- a/unoidl/inc/unoidl/unoidlprovider.hxx +++ b/unoidl/inc/unoidl/unoidlprovider.hxx @@ -34,6 +34,10 @@ public: virtual rtl::Reference< MapCursor > createRootCursor() const; // throws FileFormatException: + virtual rtl::Reference< Entity > findEntity(rtl::OUString const & name) + const; + + // throws FileFormatException: sal_uInt32 find(rtl::OUString const & name, bool * constant = 0) const; // throws FileFormatException: |