1 // Copyright (c) 1994 James Clark
2 // See the file COPYING for copying permission.
4 #ifndef RangeMap_INCLUDED
5 #define RangeMap_INCLUDED 1
14 namespace SP_NAMESPACE {
17 template<class From, class To>
18 struct RangeMapRange {
24 template<class From, class To> class RangeMapIter;
26 template<class From, class To>
30 Boolean map(From, To &, From &alsoMax) const;
31 // Return 0 for no matches, 1 for 1, 2 for more than 1.
32 unsigned inverseMap(To, From &, ISet<WideChar> &, WideChar &count) const;
33 void addRange(From, From, To);
35 Vector<RangeMapRange<From,To> > ranges_;
36 friend class RangeMapIter<From,To>;
39 template<class From, class To>
42 RangeMapIter(const RangeMap<From,To> &map);
43 Boolean next(From &fromMin, From &fromMax, To &toMin) {
47 fromMin = ptr_->fromMin;
48 fromMax = ptr_->fromMax;
57 typename Vector<RangeMapRange<From,To> >::const_iterator ptr_;
64 #endif /* not RangeMap_INCLUDED */
66 #ifdef SP_DEFINE_TEMPLATES
67 #include "RangeMap.cxx"