LibreOffice Module comphelper (master)
1
|
#include <sequenceashashmap.hxx>
Public Types | |
using | iterator = SequenceAsHashMapBase::iterator |
using | const_iterator = SequenceAsHashMapBase::const_iterator |
Public Member Functions | |
SequenceAsHashMap () | |
creates an empty hash map. More... | |
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) |
fill this map from the given Any, which of course must contain a suitable sequence of element types "css.beans.PropertyValue" or "css.beans.NamedValue". More... | |
void | operator<< (const css::uno::Sequence< css::uno::Any > &lSource) |
fill this map from the given sequence, where every Any must contain an item from type "css.beans.PropertyValue" "css.beans.NamedValue". More... | |
void | operator<< (const css::uno::Sequence< css::beans::PropertyValue > &lSource) |
fill this map from the given PropertyValue sequence. More... | |
void | operator<< (const css::uno::Sequence< css::beans::NamedValue > &lSource) |
fill this map from the given NamedValue sequence. More... | |
void | operator>> (css::uno::Sequence< css::beans::PropertyValue > &lDestination) const |
converts this map instance to an PropertyValue sequence. More... | |
void | operator>> (css::uno::Sequence< css::beans::NamedValue > &lDestination) const |
converts this map instance to an NamedValue sequence. More... | |
css::uno::Any | getAsConstAny (bool bAsPropertyValue) const |
return this map instance as an Any, which can be used in const environments only. More... | |
css::uno::Sequence< css::beans::NamedValue > | getAsConstNamedValueList () const |
return this map instance to as a NamedValue sequence, which can be used in const environments only. More... | |
css::uno::Sequence< css::beans::PropertyValue > | getAsConstPropertyValueList () const |
return this map instance to as a PropertyValue sequence, which can be used in const environments only. More... | |
template<class TValueType > | |
TValueType | getUnpackedValueOrDefault (const OUString &sKey, const TValueType &aDefault) const |
check if the specified item exists and return its (unpacked!) value or it returns the specified default value otherwise. More... | |
css::uno::Any | getValue (const OUString &sKey) const |
check if the specified item exists and return its value or it returns an empty css::uno::Any. More... | |
template<class TValueType > | |
bool | createItemIfMissing (const OUString &sKey, const TValueType &aValue) |
creates a new item with the specified name and value only in case such item name does not already exist. More... | |
bool | match (const SequenceAsHashMap &rCheck) const |
check if all items of given map exists in these called map also. More... | |
void | update (const SequenceAsHashMap &rSource) |
merge all values from the given map into this one. More... | |
css::uno::Any & | operator[] (const OUString &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 | erase (iterator it) |
size_t | erase (const OUString &rKey) |
Private Attributes | |
SequenceAsHashMapBase | m_aMap |
Definition at line 44 of file sequenceashashmap.hxx.
using comphelper::SequenceAsHashMap::const_iterator = SequenceAsHashMapBase::const_iterator |
Definition at line 324 of file sequenceashashmap.hxx.
using comphelper::SequenceAsHashMap::iterator = SequenceAsHashMapBase::iterator |
Definition at line 323 of file sequenceashashmap.hxx.
comphelper::SequenceAsHashMap::SequenceAsHashMap | ( | ) |
creates an empty hash map.
Definition at line 30 of file sequenceashashmap.cxx.
comphelper::SequenceAsHashMap::SequenceAsHashMap | ( | const css::uno::Any & | aSource | ) |
Definition at line 34 of file sequenceashashmap.cxx.
comphelper::SequenceAsHashMap::SequenceAsHashMap | ( | const css::uno::Sequence< css::uno::Any > & | lSource | ) |
Definition at line 40 of file sequenceashashmap.cxx.
comphelper::SequenceAsHashMap::SequenceAsHashMap | ( | const css::uno::Sequence< css::beans::PropertyValue > & | lSource | ) |
Definition at line 45 of file sequenceashashmap.cxx.
comphelper::SequenceAsHashMap::SequenceAsHashMap | ( | const css::uno::Sequence< css::beans::NamedValue > & | lSource | ) |
Definition at line 50 of file sequenceashashmap.cxx.
|
inline |
Definition at line 341 of file sequenceashashmap.hxx.
Referenced by operator>>().
|
inline |
Definition at line 346 of file sequenceashashmap.hxx.
|
inline |
Definition at line 326 of file sequenceashashmap.hxx.
Referenced by operator<<().
|
inline |
creates a new item with the specified name and value only in case such item name does not already exist.
To check if the property already exists only its name is used for compare. Its value isn't checked!
sKey | key name of the property. |
aValue | the new (unpacked!) value. Note: This value will be transformed to an Any internally, because only Any values can be part of a PropertyValue or NamedValue structure. |
Definition at line 275 of file sequenceashashmap.hxx.
|
inline |
Definition at line 336 of file sequenceashashmap.hxx.
|
inline |
Definition at line 351 of file sequenceashashmap.hxx.
Referenced by match(), and operator>>().
|
inline |
Definition at line 356 of file sequenceashashmap.hxx.
Definition at line 371 of file sequenceashashmap.hxx.
|
inline |
Definition at line 376 of file sequenceashashmap.hxx.
|
inline |
Definition at line 361 of file sequenceashashmap.hxx.
Referenced by match().
|
inline |
Definition at line 366 of file sequenceashashmap.hxx.
css::uno::Any comphelper::SequenceAsHashMap::getAsConstAny | ( | bool | bAsPropertyValue | ) | const |
return this map instance as an Any, which can be used in const environments only.
It's made const to prevent using of the return value directly as an in/out parameter! usage: myMethod(stlDequeAdapter.getAsAnyList());
bAsPropertyValue | switch between using of PropertyValue or NamedValue as value type. |
Definition at line 183 of file sequenceashashmap.cxx.
References getAsConstNamedValueList(), and getAsConstPropertyValueList().
css::uno::Sequence< css::beans::NamedValue > comphelper::SequenceAsHashMap::getAsConstNamedValueList | ( | ) | const |
return this map instance to as a NamedValue sequence, which can be used in const environments only.
It's made const to prevent using of the return value directly as an in/out parameter! usage: myMethod(stlDequeAdapter.getAsNamedValueList());
Definition at line 193 of file sequenceashashmap.cxx.
Referenced by getAsConstAny().
css::uno::Sequence< css::beans::PropertyValue > comphelper::SequenceAsHashMap::getAsConstPropertyValueList | ( | ) | const |
return this map instance to as a PropertyValue sequence, which can be used in const environments only.
It's made const to prevent using of the return value directly as an in/out parameter! usage: myMethod(stlDequeAdapter.getAsPropertyValueList());
Definition at line 200 of file sequenceashashmap.cxx.
Referenced by getAsConstAny().
|
inline |
check if the specified item exists and return its (unpacked!) value or it returns the specified default value otherwise.
If a value should be extracted only in case the requested property exists really (without creating of new items as it the index operator of a hash map does!) this method can be used.
sKey | key name of the item. |
aDefault | the default value, which is returned if the specified item could not be found. |
Definition at line 215 of file sequenceashashmap.hxx.
Referenced by comphelper::MimeConfigurationHelper::GetDefaultFilterFromServiceName(), comphelper::MimeConfigurationHelper::GetExportFilterFromImportFilter(), and comphelper::MimeConfigurationHelper::SearchForFilter().
|
inline |
check if the specified item exists and return its value or it returns an empty css::uno::Any.
If a value should be extracted only in case the requested property exists really (without creating of new items as the index operator of a hash map does!) this method can be used.
sKey | key name of the item. |
Definition at line 244 of file sequenceashashmap.hxx.
bool comphelper::SequenceAsHashMap::match | ( | const SequenceAsHashMap & | rCheck | ) | const |
check if all items of given map exists in these called map also.
Every item of the given map must exists with same name and value inside these map. But these map can contain additional items which are not part of the search-map.
rCheck | the map containing all items for checking. |
Definition at line 207 of file sequenceashashmap.cxx.
void comphelper::SequenceAsHashMap::operator<< | ( | const css::uno::Any & | aSource | ) |
fill this map from the given Any, which of course must contain a suitable sequence of element types "css.beans.PropertyValue" or "css.beans.NamedValue".
aSource | contains the new items for this map. |
A | css::lang::IllegalArgumentException is thrown, if the given Any does not contain a suitable sequence ... but not if it's a VOID Any! |
Definition at line 55 of file sequenceashashmap.cxx.
References clear().
void comphelper::SequenceAsHashMap::operator<< | ( | const css::uno::Sequence< css::uno::Any > & | lSource | ) |
fill this map from the given sequence, where every Any must contain an item from type "css.beans.PropertyValue" "css.beans.NamedValue".
lSource | contains the new items for this map. |
A | css::lang::IllegalArgumentException is thrown, if the given Any sequence uses wrong types for its items. VOID Any will be ignored! |
Definition at line 84 of file sequenceashashmap.cxx.
References i.
void comphelper::SequenceAsHashMap::operator<< | ( | const css::uno::Sequence< css::beans::PropertyValue > & | lSource | ) |
fill this map from the given PropertyValue sequence.
lSource | contains the new items for this map. |
Definition at line 127 of file sequenceashashmap.cxx.
References i.
void comphelper::SequenceAsHashMap::operator<< | ( | const css::uno::Sequence< css::beans::NamedValue > & | lSource | ) |
fill this map from the given NamedValue sequence.
lSource | contains the new items for this map. |
Definition at line 138 of file sequenceashashmap.cxx.
References i.
void comphelper::SequenceAsHashMap::operator>> | ( | css::uno::Sequence< css::beans::PropertyValue > & | lDestination | ) | const |
void comphelper::SequenceAsHashMap::operator>> | ( | css::uno::Sequence< css::beans::NamedValue > & | lDestination | ) | const |
|
inline |
Definition at line 318 of file sequenceashashmap.hxx.
|
inline |
Definition at line 331 of file sequenceashashmap.hxx.
Referenced by operator>>().
void comphelper::SequenceAsHashMap::update | ( | const SequenceAsHashMap & | rSource | ) |
merge all values from the given map into this one.
Existing items will be overwritten ... missing items will be created new ... but non specified items will stay alive !
rSource | the map containing all items for the update. |
Definition at line 226 of file sequenceashashmap.cxx.
References sName.
|
private |
Definition at line 382 of file sequenceashashmap.hxx.