46#pragma warning(disable:4510 4512 4610)
50 const std::string
str;
64 insert(entries[i].str, entries[i].key, checkDuplicates);
65 }
while (entries[i++].key != terminatorKey);
69 void insert(
const std::string str,
const T key,
bool checkDuplicates =
true) {
70 if (checkDuplicates) {
84 void addAlias(
const std::string str,
const T key) {
89 void remove(
const std::string str,
const T key) {
95 T
get(
const std::string& str)
const {
119 bool has(
const T key)
const {
130 std::vector<std::string> result;
132 result.push_back(item.second);
139 std::vector<T> result;
141 result.push_back(item.first);
148 typename std::map<T, std::string>::const_iterator it;
150 list.push_back(it->first);
160 result.append(item.second +
"\n");
const std::string & getString(const T key) const
get string
void remove(const std::string str, const T key)
remove string
std::vector< std::string > getStrings() const
get all strings
bool has(const T key) const
check if the given key exist
std::vector< T > getValues() const
get all keys
bool hasString(const std::string &str) const
check if the given string exist
StringBijection(Entry entries[], T terminatorKey, bool checkDuplicates=true)
parameter constructor
StringBijection()
default constructor
std::string getMultilineString() const
get multiline string (all strings concatenated and separated by ' ')
int size() const
get number of key-attributes
std::map< std::string, T > myString2T
map with the keys vinculated with strings
void addAlias(const std::string str, const T key)
add alias to the given key
T get(const std::string &str) const
get key
void addKeysInto(std::vector< T > &list) const
add the given list of keys
std::map< T, std::string > myT2String
map with the strings vinculated with keys
void insert(const std::string str, const T key, bool checkDuplicates=true)
insert string and their associated key