54PatternHash::const_iterator findPatternKey(
PatternHash const * hash,
const OUString& sURL)
56 return std::find_if(hash->begin(), hash->end(),
57 [&sURL](
const PatternHash::value_type& rEntry) {
58 WildCard aPattern(rEntry.first);
59 return aPattern.Matches(sURL);
135 *pReturn = (*s_pHandler)[pItem->second];
170 : ConfigItem(sPackage)
192 sal_Int32 nSourceCount = lNames.getLength();
193 sal_Int32 nTargetCount = nSourceCount;
195 css::uno::Sequence< OUString > lFullNames ( nTargetCount );
196 auto lFullNamesRange = asNonConstRange(lFullNames);
200 for( nSource=0; nSource<nSourceCount; ++nSource )
202 lFullNamesRange[nTarget] =
213 css::uno::Sequence< css::uno::Any > lValues =
GetProperties( lFullNames );
214 SAL_WARN_IF( lFullNames.getLength()!=lValues.getLength(),
"fwk",
"HandlerCFGAccess::read(): Miss some configuration values of handler set!" );
218 for( nTarget=0; nTarget<nTargetCount; ++nTarget )
222 aHandler.
m_sUNOName = ::utl::extractFirstFromConfigurationPath(lNames[nSource]);
225 css::uno::Sequence< OUString > lTemp;
226 lValues[nTarget] >>= lTemp;
232 rPatternHash[item] = lNames[nSource];
236 rHandlerHash[lNames[nSource]] = aHandler;
246 read(aHandler, aPattern);
static std::vector< OUString > convert_seqOUString2OUStringList(const css::uno::Sequence< OUString > &lSource)
converts a sequence of unicode strings into a vector of such items
implements configuration access for handler configuration @descr We use the ConfigItem mechanism to r...
virtual void Notify(const css::uno::Sequence< OUString > &lPropertyNames) override
virtual void ImplCommit() override
void setCache(HandlerCache *pCache)
void read(HandlerHash &rHandlerHash, PatternHash &rPatternHash)
use base class mechanism to fill given structures @descr User use us as a wrapper between configurati...
HandlerCFGAccess(const OUString &sPackage)
dtor of the config access class @descr It opens the configuration package automatically by using base...
static HandlerCFGAccess * s_pConfig
informs about config updates
static sal_Int32 m_nRefCount
ref count to construct/destruct internal member lists on demand by using singleton mechanism
HandlerCache()
ctor of the cache of all registered protocol handler @descr It tries to open the right configuration ...
void takeOver(HandlerHash aHandler, PatternHash aPattern)
static std::optional< PatternHash > s_pPattern
maps URL pattern to handler names
static std::optional< HandlerHash > s_pHandler
list of all registered handler registered by her uno implementation names
bool search(const OUString &sURL, ProtocolHandler *pReturn) const
dtor of the cache @descr It frees all used memory.
~HandlerCache()
dtor of the cache @descr It frees all used memory.
bool EnableNotification(const css::uno::Sequence< OUString > &rNames, bool bEnableInternalNotification=false)
static css::uno::Sequence< css::uno::Any > GetProperties(css::uno::Reference< css::container::XHierarchicalNameAccess > const &xHierarchyAccess, const css::uno::Sequence< OUString > &rNames, bool bAllLocales)
static css::uno::Sequence< OUString > GetNodeNames(css::uno::Reference< css::container::XHierarchicalNameAccess > const &xHierarchyAccess, const OUString &rNode, ConfigNameFormat eFormat)
#define SAL_WARN_IF(condition, area, stream)
std::unordered_map< OUString, OUString > PatternHash
This hash use registered pattern of all protocol handlers as keys and provide her uno implementation ...
std::unordered_map< OUString, ProtocolHandler > HandlerHash
This hash holds protocol handler structs by her names.
constexpr OUStringLiteral PACKAGENAME_PROTOCOLHANDLER
constexpr OUStringLiteral SETNAME_HANDLER
#define PROPERTY_PROTOCOLS
#define CFG_PATH_SEPARATOR
name of our configuration package
Programmer can register his own services to handle different protocols.
std::vector< OUString > m_lProtocols
list of URL pattern which defines the protocols which this handler is registered for
OUString m_sUNOName
the uno implementation name of this handler