bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Class Keydata - similar entries from multiple sections?


From: David Sugar
Subject: Re: Class Keydata - similar entries from multiple sections?
Date: Tue, 12 Jun 2007 08:34:18 -0400
User-agent: Thunderbird 1.5.0.8 (X11/20061107)

Normally you would load each [] into a different keydata object.  If you
merge keydata sections into a single object instance, there is no means
to determine which instance it was loaded under.  Mostly merging is
meant to load "default" keys into a given object, and then override them
with live values.  At least that was the intended use.

Wolfgang Alper wrote:
> Hello,
> i am using commoncpp2-1.5.6.
> 
> How can i retrieve keys with the same name from a given section using the 
> Class Keydata?
> 
> Example:
> [general]
> port = 1234
> host = www.myhost.com
> [proxy]
> port = 4321
> host = www.proxy.com
> 
> running 
> load("/mydir/myfile/general");
> and 
> load("/mydir/myfile/proxy]");
> 
> This leads to multiple port and host entries. 
> 
> Of cause i can use getCount("port") and then iterate through the values, but 
> this assumes to know wether a section has a key "port".
> Also i could use clrValue("port") to clear the value before loading a new 
> section, but this seems to be a bad workaround.
> 
> So how can i  query like "general/host" to get the value of host in the 
> [general] section or "proxy/host" to get the host in the [proxy] section?
> 
> Thanks 
> 
> Wolfgang
> 
> 
> 
> _______________________________________________
> Bug-commoncpp mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/bug-commoncpp

Attachment: dyfet.vcf
Description: Vcard


reply via email to

[Prev in Thread] Current Thread [Next in Thread]