LibreOffice Module filter (master) 1
Public Member Functions | List of all members
filter::config::CacheItem Class Reference

represent an item of a FilterCache instance. More...

#include <cacheitem.hxx>

Inheritance diagram for filter::config::CacheItem:
[legend]
Collaboration diagram for filter::config::CacheItem:
[legend]

Public Member Functions

 CacheItem ()
 creates an empty item. More...
 
void update (const CacheItem &rUpdateItem)
 update only properties, which are given by the specified rItem. More...
 
bool haveProps (o3tl::span< const css::beans::NamedValue > lProps) const
 check, if the given properties exist at this item. More...
 
bool dontHaveProps (o3tl::span< const css::beans::NamedValue > lProps) const
 check, if the given properties don't exist at this item. More...
 
void validateUINames (const OUString &sActLocale)
 because we know two UIName properties (a list with all locales and the value for the current locale only), we must be sure that the correspond together. More...
 
css::uno::Sequence< css::beans::PropertyValue > getAsPackedPropertyValueList (bool bFinalized, bool bMandatory) const
 convert this structure to a seq< PropertyValue > and ignore all empty properties! More...
 
- Public Member Functions inherited from comphelper::SequenceAsHashMap
 SequenceAsHashMap ()
 
 SequenceAsHashMap (const css::uno::Any &aSource)
 
 SequenceAsHashMap (const css::uno::Sequence< css::uno::Any > &lSource)
 
 SequenceAsHashMap (const css::uno::Sequence< css::beans::PropertyValue > &lSource)
 
 SequenceAsHashMap (const css::uno::Sequence< css::beans::NamedValue > &lSource)
 
void operator<< (const css::uno::Any &aSource)
 
void operator<< (const css::uno::Sequence< css::uno::Any > &lSource)
 
void operator<< (const css::uno::Sequence< css::beans::PropertyValue > &lSource)
 
void operator<< (const css::uno::Sequence< css::beans::NamedValue > &lSource)
 
void operator>> (css::uno::Sequence< css::beans::PropertyValue > &lDestination) const
 
void operator>> (css::uno::Sequence< css::beans::NamedValue > &lDestination) const
 
css::uno::Any getAsConstAny (bool bAsPropertyValue) const
 
css::uno::Sequence< css::beans::NamedValue > getAsConstNamedValueList () const
 
css::uno::Sequence< css::beans::PropertyValue > getAsConstPropertyValueList () const
 
TValueType getUnpackedValueOrDefault (const OUString &sKey, const TValueType &aDefault) const
 
css::uno::Any getValue (const OUString &sKey) const
 
bool createItemIfMissing (const OUString &sKey, const TValueType &aValue)
 
bool match (const SequenceAsHashMap &rCheck) const
 
void update (const SequenceAsHashMap &rSource)
 
css::uno::Any & operator[] (const OUString &rKey)
 
css::uno::Any & operator[] (const OUStringAndHashCode &rKey)
 
void clear ()
 
size_t size () const
 
bool empty () const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
iterator find (const OUString &rKey)
 
const_iterator find (const OUString &rKey) const
 
iterator find (const OUStringAndHashCode &rKey)
 
const_iterator find (const OUStringAndHashCode &rKey) const
 
iterator erase (iterator it)
 
size_t erase (const OUString &rKey)
 

Additional Inherited Members

- Public Types inherited from comphelper::SequenceAsHashMap
typedef SequenceAsHashMapBase::iterator iterator
 
typedef SequenceAsHashMapBase::const_iterator const_iterator
 

Detailed Description

represent an item of a FilterCache instance.

@descr This class is not threadsafe tp perform operations, which use many instances of this class! Synchronizations must be done outside.

Definition at line 39 of file cacheitem.hxx.

Constructor & Destructor Documentation

◆ CacheItem()

filter::config::CacheItem::CacheItem ( )

creates an empty item.

Definition at line 35 of file cacheitem.cxx.

Member Function Documentation

◆ dontHaveProps()

bool filter::config::CacheItem::dontHaveProps ( o3tl::span< const css::beans::NamedValue >  lProps) const

check, if the given properties don't exist at this item.

@descr All properties are compared in its minimum. E.g: string lists => only the requested items are checked. Additional existing items are ignored.

Parameters
lPropscontains all properties, which should not exist at this item.
Returns
sal_False if at least on property exists at this item(!); sal_True otherwise.

Definition at line 291 of file cacheitem.cxx.

References comphelper::SequenceAsHashMap::end(), comphelper::SequenceAsHashMap::find(), and filter::config::isSubSet().

◆ getAsPackedPropertyValueList()

css::uno::Sequence< css::beans::PropertyValue > filter::config::CacheItem::getAsPackedPropertyValueList ( bool  bFinalized,
bool  bMandatory 
) const

convert this structure to a seq< PropertyValue > and ignore all empty properties!

@descr Normally the converter routines of the base class SequenceAsHashMap do this job already. But it doesn't provide a "pack" mechanism to ignore properties with empty (means "void") values.

Returns
css::uno::Sequence< css::beans::PropertyValue > as a list of all properties of this cacheitem, where empty properties was removed.

Definition at line 80 of file cacheitem.cxx.

References comphelper::SequenceAsHashMap::begin(), comphelper::SequenceAsHashMap::end(), gentoken::i, PROPNAME_FINALIZED, PROPNAME_MANDATORY, and comphelper::SequenceAsHashMap::size().

Referenced by filter::config::FilterCache::getItemWithStateProps().

◆ haveProps()

bool filter::config::CacheItem::haveProps ( o3tl::span< const css::beans::NamedValue >  lProps) const

check, if the given properties exist at this item.

@descr All properties are compared in its minimum. E.g: string lists => only the requested items are checked. Additional existing items are ignored.

Parameters
lPropscontains all properties, which must exist at this item.
Returns
sal_True if all given properties exists at this item; sal_False otherwise.

Definition at line 266 of file cacheitem.cxx.

References comphelper::SequenceAsHashMap::end(), comphelper::SequenceAsHashMap::find(), and filter::config::isSubSet().

◆ update()

void filter::config::CacheItem::update ( const CacheItem rUpdateItem)

update only properties, which are given by the specified rItem.

@descr Update means: - add new properties

  • change existing values
Parameters
rUpdateItemanother cache item, which contains some special properties, which should by used for updating this one.

Definition at line 40 of file cacheitem.cxx.

◆ validateUINames()

void filter::config::CacheItem::validateUINames ( const OUString &  sActLocale)

because we know two UIName properties (a list with all locales and the value for the current locale only), we must be sure that the correspond together.

Parameters
sActLocalemust specify the current office locale. It's needed to address the UIName property inside the list of possible ones.

Definition at line 47 of file cacheitem.cxx.

References comphelper::SequenceAsHashMap::empty(), comphelper::SequenceAsHashMap::end(), comphelper::SequenceAsHashMap::find(), comphelper::SequenceAsHashMap::getAsConstPropertyValueList(), PROPNAME_UINAME, and PROPNAME_UINAMES.

Referenced by filter::config::FilterCache::setItem().


The documentation for this class was generated from the following files: