//-------------------------------------------------------------- //-------------------------------------------------------------- bool AppDataStore::TryGetValue(const std::string& in_key, u16& 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 = static_cast<u16>(ParseU32(strTempValue)); } return bSuccess; }
//-------------------------------------------------- //-------------------------------------------------- template <> u32 GetAttributeValue<u32>(const XML::Node* in_node, const std::string& in_attributeName, const u32& in_defaultValue) { for(rapidxml::xml_attribute<>* attribute = in_node->first_attribute(); attribute != nullptr; attribute = attribute->next_attribute()) { if (GetName(attribute) == in_attributeName) { return ParseU32(GetValue(attribute)); } } return in_defaultValue; }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------ template <> u32 ParseValue(const std::string& in_value) { return ParseU32(in_value); }