/usr/include/OpenSP/SubstTable.h is in libosp-dev 1.5.2-10.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | // Copyright (c) 1994 James Clark, 2000 Matthias Clasen
// See the file COPYING for copying permission.
#ifndef SubstTable_INCLUDED
#define SubstTable_INCLUDED
#include "types.h"
#include "StringC.h"
#include "Vector.h"
#ifdef SP_NAMESPACE
namespace SP_NAMESPACE {
#endif
class SP_API SubstTable {
public:
SubstTable();
void addSubst(Char from, Char to);
void subst(Char &) const;
void subst(StringC &) const;
Char operator[](Char from) const;
void sort() const;
Char at(Char from) const;
StringC inverse(Char to) const;
void inverseTable(SubstTable &) const;
struct Pair {
Pair() {}
Pair(Char f, Char t) : from(f), to(t) {}
Char from;
Char to;
};
private:
Char lo_[256];
mutable Vector<Pair> map_;
mutable bool isSorted_;
};
inline
void SubstTable::subst(StringC &str) const
{
for (size_t i = 0; i < str.size(); i++)
subst(str[i]);
}
inline
Char SubstTable::operator[](Char t) const
{
if (t < 256)
return lo_[t];
else
return at(t);
}
inline
void SubstTable::subst(Char &c) const
{
c = operator[](c);
}
#ifdef SP_NAMESPACE
}
#endif
#endif /* SubstTable_INCLUDED */
|