Exemple #1
0
void TIniFile::ReadSections(TStringList &Strings)
{
	long I;
	wxString Section;

	// Assert( !! Strings , SStringsUnassignedError );
	Strings.BeginUpdate();
	try
	{
		Strings.Clear();
		if (FFileBuffer->Count() > 0)
		{
			I = 0;
			while ((I < FFileBuffer->Count()))
			{
				if (IsSection(FFileBuffer->Item(I)))
				{
					Section = Trim(FFileBuffer->Item(I));
					Delete(Section, 0, 1);
					Delete(Section, Length(Section) - 1, 1);
					Strings.Add(Trim(Section));
				}
				++I;
			}
		}
	} /* ? *//* FINALLY */
	catch (...)
	{
		Strings.EndUpdate();
	}
}
Exemple #2
0
void TIniFile::ReadSectionNames(const wxString &Section, TStringList &Strings)
{
	wxString N;
	wxString V;
	int I;

	// Assert( !! Strings , SStringsUnassignedError );
	Strings.BeginUpdate();
	try
	{
		Strings.Clear();
		if (FFileBuffer->Count() > 0)
		{
			I = GetSectionIndex(Section);
			if (I != -1)
			{
				++I;
				while ((I < FFileBuffer->Count()) && !IsSection
				  (FFileBuffer->Item(I)))
				{
					N = GetName(FFileBuffer->Item(I));
					if (N != EmptyStr)
					{
						Strings.Add(N);
					}
					++I;
				}
			}
		}
	} /* ? *//* FINALLY */
	catch (...)
	{
		Strings.EndUpdate();
	}
}
Exemple #3
0
/* Read all Names of one Section */
void TIniFile::ReadSection(const wxString &Section, TStringList &Strings)
{
	int I;
	wxString N;
	Strings.BeginUpdate();
	Strings.Clear();
	if (FFileBuffer->Count() > 0)
	{
		I = GetSectionIndex(Section);
		if (I != -1)
		{
			++I;
			while ((I < FFileBuffer->Count()) && !IsSection
			  (FFileBuffer->Item(I)))
			{
				N = GetName(FFileBuffer->Item(I));
				if (N != EmptyStr)
					Strings.Add(N);
				++I;
			}
		}
	}
}