コード例 #1
0
        //--------------------------------------------------------------
        //--------------------------------------------------------------
		bool AppDataStore::TryGetValue(const std::string& in_key, s32& 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<s32>(ParseS32(strTempValue));
			}
			return bSuccess;			
		}
コード例 #2
0
 //--------------------------------------------------
 //--------------------------------------------------
 template <> s32 GetAttributeValue<s32>(const XML::Node* in_node, const std::string& in_attributeName, const s32& in_defaultValue)
 {
     for(rapidxml::xml_attribute<>* attribute = in_node->first_attribute(); attribute != nullptr; attribute = attribute->next_attribute())
     {
         if (GetName(attribute) == in_attributeName)
         {
             return ParseS32(GetValue(attribute));
         }
     }
     
     return in_defaultValue;
 }
コード例 #3
0
 //------------------------------------------------------------------------------
 //------------------------------------------------------------------------------
 template <> s32 ParseValue(const std::string& in_value)
 {
     return ParseS32(in_value);
 }