1 /* $XConsortium: SubstTable.h /main/1 1996/07/29 17:05:53 cde-hp $ */
2 // Copyright (c) 1994 James Clark
3 // See the file COPYING for copying permission.
5 #ifndef SubstTable_INCLUDED
6 #define SubstTable_INCLUDED
13 namespace SP_NAMESPACE {
20 void addSubst(T from, T to);
21 void subst(T &c) const { if (table_.size() > 0) c = table_[c]; }
22 void subst(String<T> &) const;
23 T operator[](T c) const { return table_.size() > 0 ? table_[c] : c; }
24 String<T> inverse(T) const;
25 void inverseTable(SubstTable<T> &) const;
28 String<T> pairs_; // mutable
29 Boolean pairsValid_; // mutable
36 #endif /* SubstTable_INCLUDED */
38 #ifdef SP_DEFINE_TEMPLATES
39 #include "SubstTable.C"