userver
C++ Async Framework
Toggle main menu visibility
Documentation
API Groups
Namespaces
Reference
Class List
Class Index
File List
Macros
All
e
i
l
r
t
u
Functions
Macros
e
i
l
r
t
u
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Concepts
Loading...
Searching...
No Matches
str_icase_containers.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/utils/str_icase_containers.hpp
4
/// @brief Contains utilities for working with containers with
5
/// utils::StrCaseHash and utils::StrIcaseHash.
6
/// @ingroup userver_universal
7
8
#
include
<
unordered_map
>
9
#
include
<
unordered_set
>
10
11
#
include
<
userver
/
utils
/
algo
.
hpp
>
12
#
include
<
userver
/
utils
/
str_icase
.
hpp
>
13
14
USERVER_NAMESPACE_BEGIN
15
16
namespace
utils
{
17
18
/// @brief Converts an unordered [multi-]map or set with the default hash to a
19
/// map with utils::StrCaseHash. This might be useful when converting
20
/// guaranteed-to-be-safe data to a common operating format.
21
template
<
typename
Key,
typename
Value>
22
auto
WithSafeHash
(
const
std::unordered_map<Key, Value>& map) {
23
return
utils
::AsContainer<std::unordered_map<Key, Value,
utils
::
StrCaseHash
>>(map);
24
}
22
auto
WithSafeHash
(
const
std::unordered_map<Key, Value>& map) {
…
}
25
26
/// @overload
27
template
<
typename
Key,
typename
Value>
28
auto
WithSafeHash
(std::unordered_map<Key, Value>&& map) {
29
return
utils
::AsContainer<std::unordered_map<Key, Value,
utils
::
StrCaseHash
>>(std::move(map));
30
}
28
auto
WithSafeHash
(std::unordered_map<Key, Value>&& map) {
…
}
31
32
/// @overload
33
template
<
typename
Key,
typename
Value>
34
auto
WithSafeHash
(
const
std::unordered_multimap<Key, Value>& map) {
35
return
utils
::AsContainer<std::unordered_multimap<Key, Value,
utils
::
StrCaseHash
>>(map);
36
}
34
auto
WithSafeHash
(
const
std::unordered_multimap<Key, Value>& map) {
…
}
37
38
/// @overload
39
template
<
typename
Key,
typename
Value>
40
auto
WithSafeHash
(std::unordered_multimap<Key, Value>&& map) {
41
return
utils
::AsContainer<std::unordered_multimap<Key, Value,
utils
::
StrCaseHash
>>(std::move(map));
42
}
40
auto
WithSafeHash
(std::unordered_multimap<Key, Value>&& map) {
…
}
43
44
/// @overload
45
template
<
typename
Key>
46
auto
WithSafeHash
(
const
std::unordered_set<Key>& map) {
47
return
utils
::AsContainer<std::unordered_set<Key,
utils
::
StrCaseHash
>>(map);
48
}
46
auto
WithSafeHash
(
const
std::unordered_set<Key>& map) {
…
}
49
50
/// @overload
51
template
<
typename
Key>
52
auto
WithSafeHash
(std::unordered_set<Key>&& map) {
53
return
utils
::AsContainer<std::unordered_set<Key,
utils
::
StrCaseHash
>>(std::move(map));
54
}
52
auto
WithSafeHash
(std::unordered_set<Key>&& map) {
…
}
55
56
/// @overload
57
template
<
typename
Key>
58
auto
WithSafeHash
(
const
std::unordered_multiset<Key>& map) {
59
return
utils
::AsContainer<std::unordered_multiset<Key,
utils
::
StrCaseHash
>>(map);
60
}
58
auto
WithSafeHash
(
const
std::unordered_multiset<Key>& map) {
…
}
61
62
/// @overload
63
template
<
typename
Key>
64
auto
WithSafeHash
(std::unordered_multiset<Key>&& map) {
65
return
utils
::AsContainer<std::unordered_multiset<Key,
utils
::
StrCaseHash
>>(std::move(map));
66
}
64
auto
WithSafeHash
(std::unordered_multiset<Key>&& map) {
…
}
67
68
}
// namespace utils
69
70
USERVER_NAMESPACE_END
userver
utils
str_icase_containers.hpp
Generated on Fri Apr 11 2025 14:26:16 for userver by
Doxygen
1.13.2