3065 some functions in the tcp module can be static
[unleashed.git] / usr / src / cmd / man / src / util / nsgmls.src / include / XcharMap.cxx
blob5f20195c2829b21aa9c68eb4c24cb6cdddf8677f
1 // Copyright (c) 1994 James Clark
2 // See the file COPYING for copying permission.
3 #pragma ident "%Z%%M% %I% %E% SMI"
5 #ifndef XcharMap_DEF_INCLUDED
6 #define XcharMap_DEF_INCLUDED 1
8 #include <stddef.h>
10 #ifdef SP_NAMESPACE
11 namespace SP_NAMESPACE {
12 #endif
14 template<class T>
15 SharedXcharMap<T>::SharedXcharMap()
19 template<class T>
20 SharedXcharMap<T>::SharedXcharMap(T defaultValue)
22 for (size_t i = 0; i < sizeof(v)/sizeof(v[0]); i++)
23 v[i] = defaultValue;
26 template<class T>
27 XcharMap<T>::XcharMap()
28 : ptr_(0)
32 template<class T>
33 XcharMap<T>::XcharMap(T defaultValue)
34 : sharedMap_(new SharedXcharMap<T>(defaultValue))
36 ptr_ = sharedMap_->ptr();
39 template<class T>
40 void XcharMap<T>::setRange(Char min, Char max, T val)
42 if (min <= max) {
43 do {
44 ptr_[min] = val;
45 } while (min++ != max);
49 #ifdef SP_NAMESPACE
51 #endif
53 #endif /* not XcharMap_DEF_INCLUDED */