diff options
Diffstat (limited to 'framework/inc/classes/protocolhandlercache.hxx')
-rw-r--r-- | framework/inc/classes/protocolhandlercache.hxx | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/framework/inc/classes/protocolhandlercache.hxx b/framework/inc/classes/protocolhandlercache.hxx index bbee8e729d89..9ecb06abda13 100644 --- a/framework/inc/classes/protocolhandlercache.hxx +++ b/framework/inc/classes/protocolhandlercache.hxx @@ -17,10 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_FRAMEWORK_INC_CLASSES_PROTOCOLHANDLERCACHE_HXX -#define INCLUDED_FRAMEWORK_INC_CLASSES_PROTOCOLHANDLERCACHE_HXX +#pragma once #include <unordered_map> +#include <optional> #include <com/sun/star/util/URL.hpp> @@ -29,7 +29,7 @@ namespace framework{ -#define PACKAGENAME_PROTOCOLHANDLER "Office.ProtocolHandler" /// name of our configuration package +inline constexpr OUString PACKAGENAME_PROTOCOLHANDLER = u"Office.ProtocolHandler"_ustr; /// name of our configuration package #define CFG_PATH_SEPARATOR "/" /// separator for configuration paths @@ -91,9 +91,9 @@ class HandlerCache final private: /// list of all registered handler registered by her uno implementation names - static std::unique_ptr<HandlerHash> s_pHandler; + static std::optional<HandlerHash> s_pHandler; /// maps URL pattern to handler names - static std::unique_ptr<PatternHash> s_pPattern; + static std::optional<PatternHash> s_pPattern; /// informs about config updates static HandlerCFGAccess* s_pConfig; /// ref count to construct/destruct internal member lists on demand by using singleton mechanism @@ -105,10 +105,10 @@ class HandlerCache final HandlerCache(); ~HandlerCache(); - bool search( const OUString& sURL, ProtocolHandler* pReturn ) const; - bool search( const css::util::URL& aURL, ProtocolHandler* pReturn ) const; + static bool search( const OUString& sURL, ProtocolHandler* pReturn ); + static bool search( const css::util::URL& aURL, ProtocolHandler* pReturn ); - void takeOver(std::unique_ptr<HandlerHash> pHandler, std::unique_ptr<PatternHash> pPattern); + static void takeOver(HandlerHash aHandler, PatternHash aPattern); }; /** @@ -125,7 +125,7 @@ class HandlerCache final @devstatus ready to use @threadsafe no */ -class HandlerCFGAccess : public ::utl::ConfigItem +class HandlerCFGAccess final : public ::utl::ConfigItem { private: HandlerCache* m_pCache; @@ -143,6 +143,4 @@ class HandlerCFGAccess : public ::utl::ConfigItem } // namespace framework -#endif // INCLUDED_FRAMEWORK_INC_CLASSES_PROTOCOLHANDLERCACHE_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |