21#ifndef STRING_ANY_MAP_H_
22#define STRING_ANY_MAP_H_
44 bool get_to(
const std::string& aKey, T& aVar )
const
49 return at( aKey ).GetAs( &aVar );
53 bool get_to_iu(
const std::string& aKey, T& aVar )
const
58 const wxAny& value = at( aKey );
60 if( value.CheckType<
double>() || value.CheckType<
int>() || value.CheckType<
long>()
61 || value.CheckType<
long long>() )
65 if( !value.GetAs( &number ) )
73 if( !value.GetAs( &aVar ) )
81 void set(
const std::string& aKey,
const T& aVar )
83 emplace( aKey, aVar );
87 void set_iu(
const std::string& aKey,
const T& aVar)
94 return find( aKey ) != end();
98 std::optional<T>
get_opt(
const std::string& aKey )
const
104 if( !at( aKey ).GetAs( &val ) )
A name/value tuple with unique names and wxAny values.
void set_iu(const std::string &aKey, const T &aVar)
bool get_to(const std::string &aKey, T &aVar) const
bool contains(const std::string &aKey) const
std::optional< T > get_opt(const std::string &aKey) const
STRING_ANY_MAP(double aIUScale=1.0)
void set(const std::string &aKey, const T &aVar)
bool get_to_iu(const std::string &aKey, T &aVar) const