33 for (
size_t i = 0; i < count; i++)
34 _map.insert(std::make_pair(
UString(strings[i]), i));
42 if (space != sStr.
end())
46 StrMap::const_iterator s =
_map.find(sStr);
51 *match = str + s->first.size() + 1;
60 if (space != sStr.
end())
64 StrMap::const_iterator s =
_map.find(sStr);
69 *match = str.
c_str() + s->first.size() + 1;
A class holding an UTF-8 string.
StringListMap(const char *const *strings, size_t count, bool onlyFirstWord=false)
Build a string map to match a list of strings against.
void truncate(const iterator &it)
iterator findFirst(uint32 c) const
utf8::iterator< std::string::const_iterator > iterator
const char * c_str() const
Return the (utf8 encoded) string data.
Utility templates and functions.
static const size_t kInvalidIndex
size_t find(const char *str, const char **match) const
Match a string against the map.
A map to quickly match strings from a list.