//-----------------------------------------------------------------------
	bool ConfigFileEx::hasSetting(const String& _key, const String& _section) const
	{
		SettingsBySection::const_iterator secIt = mSettings.find(_section);

		if (secIt == mSettings.end())
			return false;

		SettingsMultiMap* sec = secIt->second;
		SettingsMultiMap::const_iterator it = sec->find(_key);
		return (it != sec->end());
	}
	//-----------------------------------------------------------------------
	void ConfigFileEx::load(const DataStreamExPtr& _dataStream, const String& _separators, const String& _comments, ConfigFileExFlags _flags)
	{
		if( !_flags.check( ConfigFileExFlags::MERGE ))
			_clear();

		if(_dataStream->getEncoding().empty())
			_dataStream->setEncoding("UTF-8");

		String currentSection = "";
		SettingsMultiMap* currentSettings = OGRE_NEW_T(SettingsMultiMap, MEMCATEGORY_GENERAL)();
		mSettings[currentSection] = currentSettings;

		/* Process the file line for line */
		String line, optName, optVal;
		while (!_dataStream->eof())
		{
			_dataStream->readLine(line, EOL::CRLF);
			/* Ignore comments & blanks */
			if (line.length() > 0 && line.find_first_of(_comments) != 0)
			{
				if (line.at(0) == '[' && line.at(line.length()-1) == ']')
				{
					// Section
					currentSection = line.substr(1, line.length() - 2);
					SettingsBySection::const_iterator seci = mSettings.find(currentSection);
					if (seci == mSettings.end())
					{
						currentSettings = OGRE_NEW_T(SettingsMultiMap, MEMCATEGORY_GENERAL)();
						mSettings[currentSection] = currentSettings;
					}
					else
					{
						currentSettings = seci->second;
					} 
				}
				else
				{
					/* Find the first seperator character and split the string there */
					size_t separator_pos = line.find_first_of(_separators, 0);
					if (separator_pos != String::npos)
					{
						optName = line.substr(0, separator_pos);
						/* Find the first non-seperator character following the name */
						String::size_type nonseparator_pos = line.find_first_not_of(_separators, separator_pos);
						/* ... and extract the value */
						/* Make sure we don't crash on an empty setting (it might be a valid value) */
						optVal = (nonseparator_pos == String::npos) ? "" : line.substr(nonseparator_pos);
						if(!_flags.check( ConfigFileExFlags::NO_TRIM_WHITESPACES))
						{
							StringUtil::trim(optVal);
							StringUtil::trim(optName);
						}
						optVal = deconvertSpecialChars(optVal);
						SettingsMultiMap::iterator setit = currentSettings->end();
						if( !_flags.check( ConfigFileExFlags::MULTI_SETTINGS ))
						{
							setit = currentSettings->find(optName);
						}
						if(setit == currentSettings->end())
						{
							setit = currentSettings->insert(SettingsMultiMap::value_type(optName, String()));
						}
						setit->second = optVal;
					}
				}
			}
		}
		loaded();
	}