27 #include <rtl/ustring.hxx>
38 template<
typename Val >
58 template<
typename Val >
65 m_aRegexp(rTheRegexp), m_aValue(rTheValue) {}
69 template<
typename Val >
76 typedef typename std::vector< Entry< Val > >::iterator
ListIterator;
83 ListIterator aTheIndex);
101 typename std::vector< Entry< Val > >::iterator
m_aIndex;
107 template<
typename Val >
109 m_aEntry(OUString(), nullptr),
115 template<
typename Val >
118 m_aEntry(OUString(), nullptr),
135 template<
typename Val >
139 m_aEntry(OUString(), nullptr),
146 template<
typename Val >
149 m_aEntry(rOther.m_aEntry), m_pMap(rOther.m_pMap), m_nList(rOther.m_nList),
150 m_bEntrySet(rOther.m_bEntrySet)
156 template<
typename Val >
167 m_aIndex =
typename std::vector< Entry<Val> >::iterator();
174 template<
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());
203 template<
typename Val >
209 = m_nList == -1 ? *m_pMap->m_pDefault : *m_aIndex;
212 const_cast< Val *
>(&rTheEntry.
m_aValue));
218 template<
typename Val >
224 template<
typename Val >
228 return m_pMap == rOther.
m_pMap
230 && (m_nList == -1 || m_aIndex == rOther.
m_aIndex);
234 template<
typename Val >
255 template<
typename Val >
261 template<
typename Val >
268 template<
typename Val >
277 void add(OUString
const & rKey, Val
const & rValue);
279 iterator
find(OUString
const & rKey);
281 void erase(iterator
const & rPos);
285 const_iterator
begin()
const;
289 const_iterator
end()
const;
291 size_type
size()
const;
293 Val
const *
map(OUString
const & rString)
const;
300 template<
typename Val >
315 std::vector< Entry<Val> > & rTheList = m_aList[aRegexp.
getKind()];
317 for (
auto const& elem : rTheList)
319 if (elem.m_aRegexp == aRegexp)
329 template<
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)
352 template<
typename Val >
355 assert(rPos.m_pMap ==
this);
356 if (rPos.m_pMap ==
this)
358 if (rPos.m_nList == -1)
363 m_aList[rPos.m_nList].erase(rPos.m_aIndex);
367 template<
typename Val >
373 template<
typename Val >
379 template<
typename Val >
385 template<
typename Val >
391 template<
typename Val >
394 return (m_pDefault ? 1 : 0)
400 template<
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;
420 template<
typename Val >
424 return rIter1.
equals(rIter2);
427 template<
typename Val >
431 return !rIter1.
equals(rIter2);
Entry(Regexp const &rTheRegexp, Val const &rTheValue)
RegexpMapConstIter< Val > const_iterator
Val const & getValue() const
bool operator==(ucb_impl::RegexpMapConstIter< Val > const &rIter1, ucb_impl::RegexpMapConstIter< Val > const &rIter2)
RegexpMapEntry(OUString const &rTheRegexp, Val *pTheValue)
const OUString & getRegexp() const
RegexpMapConstIter & operator=(RegexpMapConstIter const &rOther)
RegexpMapIter< Val > iterator
RegexpMapIter(RegexpMap< Val > *pTheMap, int nTheList, typename RegexpMapConstIter< Val >::ListIterator aTheIndex)
RegexpMapEntry< Val > m_aEntry
bool operator!=(ucb_impl::RegexpMapConstIter< Val > const &rIter1, ucb_impl::RegexpMapConstIter< Val > const &rIter2)
RegexpMapEntry< Val > const * operator->() const
RegexpMap< Val > * m_pMap
std::vector< Entry< Val > >::iterator m_aIndex
void erase(iterator const &rPos)
std::vector< Entry< Val > >::iterator ListIterator
RegexpMapEntry< Val > * operator->()
bool equals(RegexpMapConstIter const &rOther) const
void add(OUString const &rKey, Val const &rValue)
static Regexp parse(OUString const &rRegexp)
std::vector< Entry< Val > > m_aList[Regexp::KIND_DOMAIN+1]
iterator find(OUString const &rKey)
std::unique_ptr< Entry< Val > > m_pDefault
Val const * map(OUString const &rString) const
RegexpMapIter(RegexpMap< Val > *pTheMap, bool bBegin)
RegexpMapEntry< Val > & get() const
RegexpMapConstIter & operator++()
OUString getRegexp() const
bool m_bDetectedRangeSegmentation false