|
|
Member
Status: Offline
Posts: 145
Join Date: Jan 2004
Location: Slovak Republic
|
Re: a simple .ini parser -
02-01-2005
Some notes : - Get rid of pragma once, you already have .h guard defined before it
- I recommend using C++ constructs, if you are already using classes (malloc -> new, FILE* -> std::fstream, char* -> std::string
- Wrap your parser in some napespace, so people can use it in their programs without potential conflicts
- you should trim section name after you remove [ ], example will be loaded as " FOO" instead of "FOO"
- implement removing items
- realoc is too often, will fragment memory and slow things down. I recommend allocating in blocks, like I'll allocate 10 units at start and if eleventh unit will come, I'll allocate another 10 units, allocating everytime unit comes is IMO slow and ineffective
- overall it is small good simple program

Last edited by koraX; 02-01-2005 at 12:40..
|
|
|