22 #ifndef StringBijection_h
23 #define StringBijection_h
58 #pragma warning(disable:4510 4512 4610) // no default constructor and no assignment operator; conflicts with initializer
75 insert(entries[i].str, entries[i].key, checkDuplicates);
76 }
while (entries[i++].key != terminatorKey);
80 void insert(
const std::string str,
const T key,
bool checkDuplicates =
true) {
81 if (checkDuplicates) {
95 void addAlias(
const std::string str,
const T key) {
100 void remove(
const std::string str,
const T key) {
106 T
get(
const std::string& str)
const {
130 bool has(
const T key)
const {
141 std::vector<std::string> result;
142 typename std::map<T, std::string>::const_iterator it;
144 result.push_back(it->second);
151 typename std::map<T, std::string>::const_iterator it;
153 list.push_back(it->first);
void addKeysInto(std::vector< T > &list) const
bool hasString(const std::string &str) const
std::vector< std::string > getStrings() const
void insert(const std::string str, const T key, bool checkDuplicates=true)
std::map< std::string, T > myString2T
std::map< T, std::string > myT2String
void addAlias(const std::string str, const T key)
const std::string & getString(const T key) const
StringBijection(Entry entries[], T terminatorKey, bool checkDuplicates=true)
bool has(const T key) const