I have a text file which acts like an index to several other files. The text file contains <filename.txt >, <description for file name>. Every file listed in this index file contains data that i will format and display on the screen (using MFC). The user can select the next file, or goto the previous file. Right now what i do is i open the file read the items and create a map on my end that maps filename to the description. The map works, but it seems like it isn't necessary. I read the file using CStdiofile.read string() to read the next line of text. I was hoping there is a way to read the previous line of text. I've seen several functions that let you move backwards, but it requires a byte offset. Each file description can be any size . This index file is being used in a RTS and new entries get added to the bottom of the file (the file isn't a set amount of entries and the locations will change each time)
A couple of questions:
One can i read a previous line of text?
Two If i read a line from the file is there a way to get the size (in bytes) of that line of text? Would the type of container i pass the string into matter (from the text file to CString?) This way i could just save the previous size of the string so i could use the offset functions (fseek, i don't remember what its called in the CFile class).
A couple of questions:
One can i read a previous line of text?
Two If i read a line from the file is there a way to get the size (in bytes) of that line of text? Would the type of container i pass the string into matter (from the text file to CString?) This way i could just save the previous size of the string so i could use the offset functions (fseek, i don't remember what its called in the CFile class).
Comment