qb
2.0.0.0
C++17 Actor Framework
|
A case-insensitive map implementation. More...
#include <unordered_map.h>
Public Member Functions | |
icase_basic_map ()=default | |
Default constructor. | |
icase_basic_map (icase_basic_map const &)=default | |
Copy constructor. | |
icase_basic_map (icase_basic_map &&) noexcept=default | |
Move constructor. | |
icase_basic_map (std::initializer_list< typename _Map::value_type > il) | |
Initializer list constructor. | |
icase_basic_map & | operator= (icase_basic_map const &)=default |
Copy assignment operator. | |
icase_basic_map & | operator= (icase_basic_map &&) noexcept=default |
Move assignment operator. | |
template<typename T, typename... _Args> | |
auto | emplace (T &&key, _Args &&...args) |
Emplace a new key-value pair with the key converted to lowercase. | |
template<typename T, typename... _Args> | |
auto | try_emplace (T &&key, _Args &&...args) |
Try to emplace a new key-value pair with the key converted to lowercase. | |
template<typename T> | |
auto & | at (T &&key) |
Access a value by key, with the key converted to lowercase. | |
template<typename T> | |
const auto & | at (T &&key) const |
Access a value by key, with the key converted to lowercase (const version) | |
template<typename T> | |
auto & | operator[] (T &&key) |
Access or insert a value by key, with the key converted to lowercase. | |
template<typename T> | |
auto | find (T &&key) |
Find a key-value pair by key, with the key converted to lowercase. | |
template<typename T> | |
auto | find (T &&key) const |
Find a key-value pair by key, with the key converted to lowercase (const version) | |
template<typename T> | |
bool | has (T &&key) const |
Check if a key exists in the map. | |
template<typename T> | |
auto | erase (T &&key) |
Erase a key-value pair by key, with the key converted to lowercase. |
Static Public Member Functions | |
template<typename T> | |
static std::string | convert_key (T &&key) noexcept |
Convert a key to lowercase. |
A case-insensitive map implementation.
This template class wraps any map type to provide case-insensitive string keys by converting keys to lowercase before operations.
_Map | The underlying map type |
_Trait | The trait class for string conversion (defaults to string_to_lower) |
|
inline |
Initializer list constructor.
il | Initializer list of key-value pairs |
|
inline |
Emplace a new key-value pair with the key converted to lowercase.
T | Key type |
_Args | Value constructor argument types |
key | The key (will be converted to lowercase) |
args | Arguments to construct the value |
|
inline |
Try to emplace a new key-value pair with the key converted to lowercase.
T | Key type |
_Args | Value constructor argument types |
key | The key (will be converted to lowercase) |
args | Arguments to construct the value |
|
inline |
Access a value by key, with the key converted to lowercase.
T | Key type |
key | The key (will be converted to lowercase) |
std::out_of_range | if the key is not found |
|
inline |
Access a value by key, with the key converted to lowercase (const version)
T | Key type |
key | The key (will be converted to lowercase) |
std::out_of_range | if the key is not found |
|
inline |
Access or insert a value by key, with the key converted to lowercase.
T | Key type |
key | The key (will be converted to lowercase) |
|
inline |
Find a key-value pair by key, with the key converted to lowercase.
T | Key type |
key | The key (will be converted to lowercase) |
|
inline |
Find a key-value pair by key, with the key converted to lowercase (const version)
T | Key type |
key | The key (will be converted to lowercase) |
|
inline |
Check if a key exists in the map.
T | Key type |
key | The key (will be converted to lowercase) |
|
inline |
Erase a key-value pair by key, with the key converted to lowercase.
T | Key type |
key | The key (will be converted to lowercase) |
|
inlinestaticnoexcept |
Convert a key to lowercase.
Utility method to convert a key to lowercase outside of map operations.
T | Key type |
key | The key to convert |