Re: [Dev-C++] Config File Library - libcfged
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <or...@vp...> - 2003-01-22 21:30:45
|
Hello everyone! Matthews wrote: > Anyone interested in the config file writer library mentioned a few weeks > ago, it's now available for download at > http://uk.geocities.com/revthepirate/cfged.zip It is actually: http://uk.geocities.com/revthepirate/CFGEd.zip > There's detailed instructions in there, a compiled library as well as > source code for modifying it. I'd like to see any changes you make, this > was mainly to give myself a challenge. Well, writing the configs is the easier task. Parsing them is hard. Actually I wanted to achieve the following: - sections, like [Section1] etc. - single line data, like Value=data - (!)multi line data. This is the hardest to parse. You need to convert the given string, when you write, because when you read, you need to know, where to stop. I thought of the following: (using '\' at the end of the line) MultilineData=This is a multi \ line data. \ \ And may contain empty lines, like above. \ Stop here Data2= ... I would need something like this for my project, but I have no time to implement a complete new library, and make interface for it. I have already made 3 independent libraries. Now the parser is "hacked" (hard coded) into my project. If I have time, I will make one (or extend yours), and post it to the list. Anyway, the libraries, what I have already made: xstring - A string manipulation library for C. C handles strings awfully, actually it doesn't even has strings, just char arrays, which is the source of many errors. strcpy() and similar functions can easily freeze your program. This is the reason for the existence of this library. Luckily C++ already has strings built-in, so it is recommended for "C only" users. list - simple, fast doubly linked closed list implementation, which may be sorted or unsorted given a cmp function (like to qsort()). error - last error handling library for single threaded apps. Register last error codes, assign error messages to them, set, get last errors. If you need them, let me know. Thanks anyway. -- Greetings, Balázs |