34inline std::optional<V>
get_opt(
const std::map<wxString, V>& aMap,
const wxString& aKey )
36 auto it = aMap.find( aKey );
38 if( it == aMap.end() )
46inline std::optional<V>
get_opt(
const std::map<wxString, V>& aMap,
const char* aKey )
48 return get_opt( aMap, wxString::FromUTF8( aKey ) );
52template <
typename K,
typename V>
53inline std::optional<V>
get_opt(
const std::map<K, V>& aMap,
const K& aKey )
55 auto it = aMap.find( aKey );
57 if( it == aMap.end() )
64inline wxString
get_def(
const std::map<wxString, wxString>& aMap,
const char* aKey,
65 const char* aDefval =
"" )
67 typename std::map<wxString, wxString>::const_iterator it =
68 aMap.find( wxString::FromUTF8( aKey ) );
69 if( it == aMap.end() )
71 return wxString::FromUTF8( aDefval );
80inline wxString
get_def(
const std::map<wxString, wxString>& aMap,
const char* aKey,
81 const wxString& aDefval = wxString() )
83 typename std::map<wxString, wxString>::const_iterator it =
84 aMap.find( wxString::FromUTF8( aKey ) );
85 if( it == aMap.end() )
96inline wxString
get_def(
const std::map<wxString, wxString>& aMap,
const wxString& aKey,
97 const wxString& aDefval = wxString() )
99 typename std::map<wxString, wxString>::const_iterator it = aMap.find( aKey );
100 if( it == aMap.end() )
111template <
typename K,
typename V>
112inline V
get_def(
const std::map<K, V>& aMap,
const K& aKey,
const V& aDefval = V() )
114 typename std::map<K, V>::const_iterator it = aMap.find( aKey );
115 if( it == aMap.end() )
wxString get_def(const std::map< wxString, wxString > &aMap, const char *aKey, const char *aDefval="")
std::optional< V > get_opt(const std::map< wxString, V > &aMap, const wxString &aKey)