//-------------------------------------------------------------- //-------------------------------------------------------------- bool AppDataStore::TryGetValue(const std::string& in_key, f32& out_value) const { std::unique_lock<std::mutex> lock(m_mutex); std::string strTempValue; bool bSuccess = m_dictionary.TryGetValue(in_key, strTempValue); if(bSuccess) { out_value = ParseF32(strTempValue); } return bSuccess; }
//-------------------------------------------------- //-------------------------------------------------- template <> f32 GetAttributeValue<f32>(const XML::Node* in_node, const std::string& in_attributeName, const f32& in_defaultValue) { for(rapidxml::xml_attribute<>* attribute = in_node->first_attribute(); attribute != nullptr; attribute = attribute->next_attribute()) { if (GetName(attribute) == in_attributeName) { return ParseF32(GetValue(attribute)); } } return in_defaultValue; }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------ template <> f32 ParseValue(const std::string& in_value) { return ParseF32(in_value); }