FileEngine [opensource, easy, portable] load/save data!

Discussion about everything. New games, 3d math, development tips...
Post Reply
Systemerror
Posts: 98
Joined: Fri Oct 03, 2008 1:25 pm
Location: UK
Contact:

FileEngine [opensource, easy, portable] load/save data!

Post by Systemerror »

Note pasted straight from my site:

Image


FileEngine [C++, OpenSource]

Purpose:

This will provide developers with the functionality to easily create *.txt files, read them, load them
use quick and easy functions to save/load data within your application - this is fairly restricted at the
moment as you are only working with *.txt files and the main writer function is for strings, but it is
still very useful and portable. I find this particularaly useful for games to save/load certain settings
but is not restricted to games, it is useful for complex applications that use a lot of resources.

Note: it comes with the source, a demo (source and exe) and documentation.

System requirements: N/A

License: freeware/Open source (see license once downloaded) and please donate.


Download
-System error
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

You do realise that the standard already has function to handle files, in both text and binary mode, that can work with strings?
Systemerror
Posts: 98
Joined: Fri Oct 03, 2008 1:25 pm
Location: UK
Contact:

Post by Systemerror »

Yes, it uses fstream, but I could not find functions to easily (meaning in a consise manner) to read, write, load etc files and this is just an easy example of implementing that functionality.


The good thing about it for instance it can:

Check a file exists
if so, read it
if not
write it

in this short code:

Code: Select all

/*
Purpose:

To demonstrate the basic functionality of creating on loading files

Developed by Craig Fox mailto:greyhatsoftware@hotmail.co.uk
         http://GreyHatSoftware.weebly.com

Note: you will need FileEngine.h and FileEngine.cpp included in you proj
*/

#include "FileEngine.h"


int main()
{
	 cout<<"[Example app to load and write data to a *.txt file]\n";


	 //Attempt to read data file
	 FileEngine.readFile();

	 //check if file was found
	 if(FileEngine.getWasFileFound() == false)
		 FileEngine.writeFile("This is a test string for SaveData file!");
	
     

cout<<"Finished please close me\n";
cin.get();
return 0;
}
-System error
Post Reply