Ejemplo n.º 1
0
bool Loader::ReadToken(char *token, bool trim, bool lcase)
{
	int i = 0;

	do
	{
		strcpy(token, "");
		
		EatWhitespace();
		if (!ReadString(token))
			return false;

		if ((strncmp(token, "//", 2) == 0) || (strncmp(token, "#", 1) == 0))
		{
			NextLine(); // Ignore the comment line
			strcpy(token, "");
		}
	} while (!strcmp(token, ""));
	if (trim)
		Trim(token);
	if (lcase)
		LCase(token);

	return true;
}
Ejemplo n.º 2
0
bool CIniReader::ReadBoolean(char* szSection, char* szKey, bool bolDefaultValue)
{
 char szResult[255];
 char szDefault[255];
 bool bolResult;
 sprintf(szDefault, "%s", bolDefaultValue? "true" : "false");
 GetPrivateProfileStringA(szSection, szKey, szDefault, szResult, 255, m_szFileName); 
 LCase(szResult);
 bolResult =  (strcmp(szResult, "true") == 0) ? true : false;
 return bolResult;
}