vector_multimap_iterator (const CONTAINER& container, ITERATOR_TYPE iterType = ITERATOR_TYPE::BEGIN)
     : m_position (0)
     , m_container (container)
 {
     if (iterType == ITERATOR_TYPE::END)
         m_position = container.size ();
 }
Exemple #2
0
	bool IsLocationInUse(const CONTAINER& source)
	{
		if(source.size() > 0)
			return true;

		return false;
	}
Exemple #3
0
bool CBratSettings::SaveRecentFilesGeneric( const CONTAINER &paths )
{
	auto brathlFmtEntryRecentWksMacro = []( size_t index ) -> std::string
	{
		return KEY_WKS_RECENT + n2s<std::string>( index );
	};

	//

	{
		CSection section( mSettings, GROUP_WKS_RECENT );
		const size_t size = paths.size();
		for ( size_t i = 0; i < size; ++i )
			WriteValue( section, brathlFmtEntryRecentWksMacro( i ), paths[ (typename CONTAINER::size_type) i ] );
	}

	return mSettings.status() == QSettings::NoError;
}
Exemple #4
0
bool CBratSettings::LoadRecentFilesGeneric( CONTAINER &paths )
{
	long maxEntries = 0;

	{
		CSection section( mSettings, GROUP_WKS_RECENT );
		auto const &keys = mSettings.childKeys();
        maxEntries = keys.size();
		for ( auto const &key : keys )
		{
			auto value = ReadValue< typename CONTAINER::value_type >( section, q2t< std::string >( key ) );
			paths.push_back( value );
		};
	}

	assert__( paths.size() == maxEntries );			Q_UNUSED( maxEntries );		//for release builds

	return mSettings.status() == QSettings::NoError;
}
Exemple #5
0
int HazardModule::IndexOfInstanceID(const CONTAINER& container, const HazardID instanceID) const
{
	if (instanceID == gUndefinedHazardInstanceID)
	{
		return -1;
	}

	// Ugly! In the future we should apply a decent hashing here!
	size_t index, size = container.size();
	for (index = 0 ; index < size ; index++)
	{
		if (container[index].GetInstanceID() == instanceID)
		{
			return (int)index;
		}
	}

	return -1;
}