Re: C/C++ interface to YAML files
Zenaan Harkness <[email protected]>
| Newsgroups | gmane.text.yaml.general |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Dec 19, 2007 at 07:40:29PM -0500, Chris Ross wrote:
>
> On Dec 19, 2007, at 19:36, Zenaan Harkness wrote:
> > Hi Chris, I'm using Java, jvYaml. Can't help directly. But I am
> > find it
> > awesome to be able to load YAML format files. It is really nice for
> > writing documents (files) in.
> >
> > On the other end (which in combination provides an awesome
> > pipeline), I
> > use StringTemplate (www.stringtemplate.org) by Terrence Parr.
> >
> > What is your use case?
>
> I'm developing a small suite of applications, and I need to design
> configuration file formats. Something relatively simple like having
> key-value pairs is a start, but I think I'd like to be able to have
> array's as values for some of the keys, and other such things.
>
> At the moment, getcap(3) style databases are the only format I
> support, but as that's a BSDism, and apparently doesn't exist in
> the glibc on the linux systems I've looked at, I wanted to make
> sure to write the code to use others.
>
> So, it's just for reading, in the case of my code, and it's going
> to be a pretty simply document in most (if not all) cases.
You may find a full YAML loader, which has proper support for YAML spec, is
significantly more flexibility (complexity) than you need. Here's part
of the Reference:
%YAML 1.1 # Reference card
---
Collection indicators:
'? ' : Key indicator.
': ' : Value indicator.
'- ' : Nested series entry indicator.
', ' : Separate in-line branch entries.
'[]' : Surround in-line series branch.
'{}' : Surround in-line keyed branch.
(www.yaml.org from memory)
Your arrays are right there...
zen
--
Homepage: www.SoulSound.net -- Free Australia: www.UPMART.org
Please respect the confidentiality of this email as sensibly warranted.
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace