27#include <rtl/ustring.hxx>
34template<
typename Val >
class RegexpMap;
35template<
typename Val >
class RegexpMapIter;
38template<
typename Val >
58template<
typename Val >
69template<
typename Val >
76 typedef typename std::vector< Entry< Val > >::iterator
ListIterator;
101 typename std::vector< Entry< Val > >::iterator
m_aIndex;
107template<
typename Val >
109 m_aEntry(OUString(), nullptr),
115template<
typename Val >
118 m_aEntry(OUString(), nullptr),
135template<
typename Val >
139 m_aEntry(OUString(), nullptr),
140 m_aIndex(
std::move(aTheIndex)),
146template<
typename Val >
149 m_aEntry(rOther.m_aEntry), m_pMap(rOther.m_pMap), m_nList(rOther.m_nList),
150 m_bEntrySet(rOther.m_bEntrySet)
156template<
typename Val >
167 m_aIndex =
typename std::vector< Entry<Val> >::iterator();
174template<
typename Val >
180 if (m_aIndex == m_pMap->m_aList[m_nList].end())
186 || m_aIndex != m_pMap->m_aList[m_nList].end())
193 m_aIndex = m_pMap->m_aList[m_nList].begin();
196 && m_aIndex == m_pMap->m_aList[m_nList].end());
203template<
typename Val >
209 = m_nList == -1 ? *m_pMap->m_pDefault : *m_aIndex;
212 const_cast< Val *
>(&rTheEntry.
m_aValue));
218template<
typename Val >
224template<
typename Val >
228 return m_pMap == rOther.
m_pMap
230 && (m_nList == -1 || m_aIndex == rOther.
m_aIndex);
234template<
typename Val >
255template<
typename Val >
261template<
typename Val >
268template<
typename Val >
277 void add(OUString
const & rKey, Val
const & rValue);
293 Val
const *
map(OUString
const & rString)
const;
300template<
typename Val >
315 std::vector< Entry<Val> > & rTheList = m_aList[aRegexp.
getKind()];
317 for (
auto const& elem : rTheList)
319 if (elem.m_aRegexp == aRegexp)
329template<
typename Val >
341 std::vector< Entry<Val> > & rTheList = m_aList[aRegexp.
getKind()];
343 typename std::vector< Entry<Val> >::iterator aEnd(rTheList.end());
344 for (
typename std::vector<
Entry<Val> >::iterator aIt(rTheList.begin()); aIt != aEnd; ++aIt)
345 if (aIt->m_aRegexp == aRegexp)
352template<
typename Val >
355 assert(rPos.
m_pMap ==
this);
367template<
typename Val >
373template<
typename Val >
379template<
typename Val >
385template<
typename Val >
391template<
typename Val >
394 return (m_pDefault ? 1 : 0)
400template<
typename Val >
405 std::vector< Entry<Val> >
const & rTheList = m_aList[
n];
407 for (
auto const & rItem : rTheList)
408 if (rItem.m_aRegexp.matches(rString))
409 return &rItem.m_aValue;
412 && m_pDefault->m_aRegexp.matches(rString))
413 return &m_pDefault->m_aValue;
420template<
typename Val >
424 return rIter1.
equals(rIter2);
427template<
typename Val >
431 return !rIter1.
equals(rIter2);
RegexpMapEntry< Val > & get() const
bool equals(RegexpMapConstIter const &rOther) const
std::vector< Entry< Val > >::iterator m_aIndex
RegexpMapConstIter & operator=(RegexpMapConstIter const &rOther)
RegexpMapEntry< Val > m_aEntry
RegexpMapConstIter & operator++()
RegexpMapEntry< Val > const * operator->() const
RegexpMap< Val > * m_pMap
std::vector< Entry< Val > >::iterator ListIterator
RegexpMapEntry(OUString aTheRegexp, Val *pTheValue)
const OUString & getRegexp() const
Val const & getValue() const
RegexpMapIter(RegexpMap< Val > *pTheMap, bool bBegin)
RegexpMapIter(RegexpMap< Val > *pTheMap, int nTheList, typename RegexpMapConstIter< Val >::ListIterator aTheIndex)
RegexpMapEntry< Val > * operator->()
Val const * map(OUString const &rString) const
std::vector< Entry< Val > > m_aList[Regexp::KIND_DOMAIN+1]
void add(OUString const &rKey, Val const &rValue)
const_iterator end() const
std::unique_ptr< Entry< Val > > m_pDefault
iterator find(OUString const &rKey)
void erase(iterator const &rPos)
RegexpMapIter< Val > iterator
const_iterator begin() const
RegexpMapConstIter< Val > const_iterator
OUString getRegexp() const
static Regexp parse(OUString const &rRegexp)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
bool operator==(ucb_impl::RegexpMapConstIter< Val > const &rIter1, ucb_impl::RegexpMapConstIter< Val > const &rIter2)
bool operator!=(ucb_impl::RegexpMapConstIter< Val > const &rIter1, ucb_impl::RegexpMapConstIter< Val > const &rIter2)
Entry(Regexp aTheRegexp, Val aTheValue)