Exemple #1
0
bool FeRomList::set_fav( FeRomInfo &r, FeDisplayInfo &display, bool fav )
{
	r.set_info( FeRomInfo::Favourite, fav ? "1" : "" );
	m_fav_changed=true;

	return fix_filters( display, FeRomInfo::Favourite );
}
Exemple #2
0
bool FeRomList::set_tag( FeRomInfo &rom, FeDisplayInfo &display, const std::string &tag, bool flag )
{
	std::string curr_tags = rom.get_info(FeRomInfo::Tags);
	size_t pos = curr_tags.find( FE_TAGS_SEP + tag + FE_TAGS_SEP );

	std::map<std::string, bool>::iterator itt = m_tags.begin();

	if ( flag == true )
	{
		if ( pos == std::string::npos )
		{
			rom.append_tag( tag );
			m_tags_changed = true;

			itt = m_tags.find( tag );
			if ( itt != m_tags.end() )
				(*itt).second = true;
			else
				itt = m_tags.insert( itt, std::pair<std::string,bool>( tag, true ) );
		}
	}
	else if ( pos != std::string::npos )
	{
		pos++; // because we searched for the preceeding FE_TAGS_SEP as well
		int len = tag.size();

		if (( ( pos + len ) < curr_tags.size() )
				&& ( curr_tags.at( pos + len ) == FE_TAGS_SEP ))
			len++;

		curr_tags.erase( pos, len );

		//
		// Clean up our leading FE_TAGS_SEP if there are no tags left
		//
		if (( curr_tags.size() == 1 ) && (curr_tags[0] == FE_TAGS_SEP ))
			curr_tags.clear();

		rom.set_info( FeRomInfo::Tags, curr_tags );
		m_tags_changed = true;

		itt = m_tags.find( tag );
		if ( itt != m_tags.end() )
			(*itt).second = true;
		else
			itt = m_tags.insert( itt, std::pair<std::string,bool>( tag, true ) );
	}

	return fix_filters( display, FeRomInfo::Tags );
}
Exemple #3
0
void FeMessXMLParser::set_info_values( FeRomInfo &r )
{
	r.set_info( FeRomInfo::Title, m_description );
	r.set_info( FeRomInfo::Year, m_year );
	r.set_info( FeRomInfo::Manufacturer, m_man );
	r.set_info( FeRomInfo::Cloneof, m_cloneof );
	r.set_info( FeRomInfo::AltRomname, m_altname );
	r.set_info( FeRomInfo::AltTitle, m_alttitle );
}