Ejemplo n.º 1
0
//根据当前节的名字获取下一个节
const char* MIniFile::GetNextSectionName(const char* currentSectionName)
{
	IniSection* pSection = GetNextSection(currentSectionName);

	if(0 != pSection)
		return pSection->GetSectionName();

	return "";
}
Ejemplo n.º 2
0
IniSection* MIniFile::GetSection(const char* sectionName)
{
	IniSection* pSection = 0;
	for(SectionIter iter = m_SectionList.begin(); iter != m_SectionList.end(); ++iter)
	{
		pSection = *iter;

		if((pSection != 0) && (0 == strcmp(pSection->GetSectionName(),sectionName )))
			return pSection;
	}

	return 0;
}
Ejemplo n.º 3
0
//获取一个ini文件的第一个节
const char* MIniFile::GetFirstSectionName()
{
	IniSection* pSection = 0;
	SectionIter iter = m_SectionList.begin();

	if(iter != m_SectionList.end())
	{
		pSection = *iter;
		if(0 != pSection)
			return pSection->GetSectionName();
	}

	return "";
}
Ejemplo n.º 4
0
int MIniFile::FindSection(const char *sectionName)
{
	IniSection* pSection = 0;
	for(int i = 0; i != m_SectionList.size(); ++i)
	{
		pSection = m_SectionList[i];
		if(0 == pSection)
			continue;

		if(0 == strcmp(pSection->GetSectionName(),sectionName ))
		{
			return i;
		}
	}

	return -1;
}