|
Boost Users : |
From: Marcin Kalicinski (kalita_at_[hidden])
Date: 2006-09-28 08:04:07
Hi Chris,
Un-customized ptree uses (string, string) pairs to hold data. If you are
using sandbox-cvs version (i.e. the latest one), it is easy to customize
data type to be boost::any. There's even a working example on how to do that
in libs/property_tree/examples/custom_data_type.cpp. Once you do that, you
can then manually associate types with values.
As for associating types with a values read from a file, I don't see any
easy way to do it. How would the parser determine the type of the value that
it reads in?
Best regards,
Marcin
Uzytkownik "Chris Weed" <chrisweed_at_[hidden]> napisal w wiadomosci
news:359e4bf50609272009w7a438eb7u9e1cf56011c69371_at_mail.gmail.com...
> Marcin,
> I have looked at the documentation a little bit, and I have a few
> questions.
> It is not clear in the documentation if the implementation uses
> (std::string,boost::any) pairs, but I recall reading something about
> that being the case. With that set up it seems values inserted in the
> tree, programmatically, could have type information, but values read
> from a file could only be string types. I am interested in typing
> properties read in from a file. Is there a way to associate types with
> values read from a file. If not that is fine, I can always check if
> the type is a string and use lexical_cast.
> Chris
>
> On 9/27/06, Marcin Kalicinski <kalita_at_[hidden]> wrote:
>> Hi Chris,
>>
>> The latest version is always in boost-sandbox CVS. You can access that
>> anonymously - see instructions at
>> http://boost.org/more/mailing_lists.htm#sandbox. Sandbox version is much
>> improved over what is in boost vault (which is the version used for
>> review),
>> but the documentation is yet lagging behind, so you might encounter a
>> couple
>> of surprises. The good news is that the basic interface and usage have
>> not
>> changed.
>>
>> Marcin
>>
>> ----- Original Message -----
>> From: "Chris Weed" <chrisweed_at_[hidden]>
>> Newsgroups: gmane.comp.lib.boost.user
>> Sent: Wednesday, September 27, 2006 4:47 PM
>> Subject: [Property Tree] Latest version and CVS
>>
>>
>> > Hi,
>> > I am interested in using the new Property Tree library, and I was
>> > wondering where I can get the latest version.
>> > Chris
>>
>> _______________________________________________
>> Boost-users mailing list
>> Boost-users_at_[hidden]
>> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>>
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net