20 #ifndef INCLUDED_COMPHELPER_SEQUENCEASHASHMAP_HXX
21 #define INCLUDED_COMPHELPER_SEQUENCEASHASHMAP_HXX
23 #include <unordered_map>
24 #include <com/sun/star/uno/Sequence.hxx>
67 SequenceAsHashMap(
const css::uno::Sequence< css::beans::PropertyValue >& lSource);
107 void operator<<(const css::uno::Sequence< css::uno::Any >& lSource);
116 void operator<<(const css::uno::Sequence< css::beans::PropertyValue >& lSource);
125 void operator<<(const css::uno::Sequence< css::beans::NamedValue >& lSource);
134 void operator>>(css::uno::Sequence< css::beans::PropertyValue >& lDestination)
const;
143 void operator>>(css::uno::Sequence< css::beans::NamedValue >& lDestination)
const;
161 css::uno::Any getAsConstAny(
bool bAsPropertyValue)
const;
175 css::uno::Sequence< css::beans::NamedValue > getAsConstNamedValueList()
const;
189 css::uno::Sequence< css::beans::PropertyValue > getAsConstPropertyValueList()
const;
214 template<
class TValueType >
216 const TValueType& aDefault)
const
218 auto pIt = m_aMap.find(sKey);
219 if (pIt == m_aMap.end())
222 TValueType aValue = TValueType();
223 if (!(pIt->second >>= aValue))
246 auto pIt = m_aMap.find(sKey);
247 if (pIt == m_aMap.end())
248 return css::uno::Any();
274 template<
class TValueType >
276 const TValueType& aValue)
278 if (m_aMap.find(sKey) == m_aMap.end())
280 (*this)[sKey] = css::uno::toAny(aValue);
333 return m_aMap.size();
338 return m_aMap.empty();
343 return m_aMap.begin();
348 return m_aMap.begin();
363 return m_aMap.find(rKey);
368 return m_aMap.find(rKey);
373 return m_aMap.erase(it);
378 return m_aMap.erase(rKey);
387 #endif // INCLUDED_COMPHELPER_SEQUENCEASHASHMAP_HXX
SequenceAsHashMapBase::const_iterator const_iterator
css::uno::Any & operator[](const OUString &rKey)
std::unordered_map< OUString, css::uno::Any > SequenceAsHashMapBase
Implements a stl hash map on top of some specialized sequence from type PropertyValue or NamedValue...
const_iterator begin() const
bool match(const sal_Unicode *pWild, const sal_Unicode *pStr, const sal_Unicode cEscape)
const css::uno::Reference< css::io::XObjectOutputStream > & operator<<(const css::uno::Reference< css::io::XObjectOutputStream > &_rxOutStream, const css::awt::FontDescriptor &_rFont)
iterator erase(iterator it)
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 defau...
const_iterator find(const OUString &rKey) const
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.
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 exi...
const css::uno::Reference< css::io::XObjectInputStream > & operator>>(const css::uno::Reference< css::io::XObjectInputStream > &_rxInStream, css::awt::FontDescriptor &_rFont)
iterator find(const OUString &rKey)
SequenceAsHashMapBase::iterator iterator
SequenceAsHashMapBase m_aMap
#define COMPHELPER_DLLPUBLIC
size_t erase(const OUString &rKey)
const_iterator end() const