Example #1
0
// static
void LLEventInfo::loadCategories(LLUserAuth::options_t event_options)
{
	LLUserAuth::options_t::iterator resp_it;
	for (resp_it = event_options.begin(); 
		 resp_it != event_options.end(); 
		 ++resp_it)
	{
		const LLUserAuth::response_t& response = *resp_it;

		LLUserAuth::response_t::const_iterator option_it;

		S32 cat_id = 0;
		option_it = response.find("category_id");
		if (option_it != response.end())
		{
			cat_id = atoi(option_it->second.c_str());
		}
		else
		{
			continue;
		}

		// Add the category id/name pair
		option_it = response.find("category_name");
		if (option_it != response.end())
		{
			LLEventInfo::sCategories[cat_id] = option_it->second;
		}

	}

}
void LLEventNotifier::load(const LLUserAuth::options_t& event_options)
{
	LLUserAuth::options_t::const_iterator resp_it;
	for (resp_it = event_options.begin(); 
		 resp_it != event_options.end(); 
		 ++resp_it)
	{
		const LLUserAuth::response_t& response = *resp_it;

		LLEventNotification *new_enp = new LLEventNotification();

		if (!new_enp->load(response))
		{
			delete new_enp;
			continue;
		}
		
		mEventNotifications[new_enp->getEventID()] = new_enp;
	}
}