Original Post
🔒 Locked
Parse a text file for setup data
Advertisement
Have you considered the spirit parser from the boost library? Doesn't take too long to write really small and complex parsing rules, especially if you know (e)bnf.
http://www.boost.org/libs/spirit/
http://spirit.sourceforge.net/
Downside is you need to use a compiler with good template support (msvc 7+) although older versions are compatible with msvc6 and below.
http://www.boost.org/libs/spirit/
http://spirit.sourceforge.net/
Downside is you need to use a compiler with good template support (msvc 7+) although older versions are compatible with msvc6 and below.
Quote:
Original post by MARS_999
I am thinking about using a simple parser for reading in stuff like screen widht, height ect... but not sure on how to start it? Any help or ideas would be great.
The simple way would be just to store the information sequentually. For example
320240...then you just have to remember what order the information is store. A slightly more complex method would be to put a label before each value. eg.
width 320height 240...Then you would just read in file line by line and use the space (you can use any character you please) as your delimiter to split the string.
The most complex option would probably be to use XML.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement