I have a file called "db.ini" which contains a list of ilenames that all end with '0'. I want to parse this data and find and remove the '0' and then store the new filenames in a vector of strings. This is the code i have so far but i am having a bit of trouble with making it loop onto the next file. Any ideas would be greatly appreciated:
Code:
LPCVOID buffer[9999];
char TempBuffer[sizeof(buffer)] = "";
HANDLE hFile1;
DWORD size;
LPCSTR FileName;
vector<LPCSTR> FileNames;
LPCSTR Parse()
{
char text[sizeof(buffer)] = "";
memcpy(TempBuffer, &buffer, sizeof(buffer));
for (x = 0; x != sizeof(TempBuffer); x++)
{
text[x] = TempBuffer[x];
if (text[x] == '0')
{
text[x] = text[x + '0'];
FileName = text;
FileNames.push_back(FileName);
}
else
{
FileName = text;
}
}
}
......
hFile1 = CreateFile("db.ini", GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
size = GetFileSize(hFile1, NULL);
ReadFile(hFile1, &buffer, size, &dwNumRead, NULL);
Parse();
[EDIT] Forgot to mention it gets the first name of the filenames in "db.ini" ok[/EDIT]