tags:

views:

54

answers:

3
+2  Q: 

Conf file parser

I thought there was a boost library that allowed me to parse unix conf files?

I believe it also had other features, i.e. it could parse windows ini files and I think XML based config files might have been done or was on the way too.

Any idea what that's called? I'm looking through the program options library and it doesn't look like the library documentation that I was looking to use just a couple of weeks ago.

EDIT: Ok, I think it's might have been the program options library, but I think I might have been looking at other documentation examples... maybe the tutorials.

Can someone point me in the direction of a complete tutorial to read a conf file?

EDIT: Found it. The Boost Property Tree library that I was looking for!

+2  A: 

Boost allows you to parse several configuration file formats; this facility is part of Boost.ProgramOptions.

James McNellis
A: 

You're maybe looking for Spirit

Ruel
Nope, it was ProgramOptions. Spirit is generalized parser builder.
Steve Townsend
Well, you _could_ parse configuration parsers using Spirit... that seems like a lot of work, though :-)
James McNellis
I see, I was gonna link on ProgramOptions lib, but he said he's already looking through it. So I thought its a different one.
Ruel
It might be Program options, perhaps I was looking at the example code not the docs??? I should have bookmarked it at the time!
Matt H
+1  A: 

All the answers on this page are good.

The specific library in boost I was after is called the Property Tree. However, I will point out that his is a relatively new feature and only available since the last one or two revisions. My default boost installation in Kubuntu 10.04.1 doesn't have it, so I had to download the boost library and build it myself.

Matt H