// TestConsole.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "windows.h"

#include <iostream>
#include <vector>
#include <string>
#include <sstream>

#include <json>

using namespace std;

char* CreateBuffer(int size)
{
	char* buffer = new char[size];

	ZeroMemory(buffer, size);

	return buffer;
}

int main()
{
	char iniPath[MAX_PATH] = "D:\\Games\\Fiesta\\Gamigo\\US\\Fiesta.ini";

	char* iniBuffer = CreateBuffer(128);

	GetPrivateProfileString("CustomClasses", "GroupNames", "", iniBuffer, 128, iniPath);

	stringstream stringStream(iniBuffer);
	string baseName;

	while (getline(stringStream, baseName, ','))
	{
		char* group = const_cast<char *>(("CustomClass_" + baseName).c_str());

		GetPrivateProfileString(group, "Names", "", iniBuffer, 128, iniPath);
	}

	delete[] iniBuffer;

    return 0;
}