21#ifndef STRING_ANY_MAP_H_
22#define STRING_ANY_MAP_H_
46 bool get_to(
const std::string& aKey,
T& aVar )
const
51 return at( aKey ).GetAs( &aVar );
60 const wxAny& value = at( aKey );
62 if( value.CheckType<
double>() || value.CheckType<
int>() || value.CheckType<
long>()
63 || value.CheckType<
long long>() )
67 if( !value.GetAs( &number ) )
73 if constexpr( std::is_integral_v<T> )
80 if( !value.GetAs( &aVar ) )
88 void set(
const std::string& aKey,
const T& aVar )
90 emplace( aKey, aVar );
94 void set_iu(
const std::string& aKey,
const T& aVar)
104 template <
typename T>
105 std::optional<T>
get_opt(
const std::string& aKey )
const
111 if( !at( aKey ).GetAs( &val ) )
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
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