Boost logo

Boost Users :

From: Chris Weed (chrisweed_at_[hidden])
Date: 2006-10-01 13:02:02


Thanks for the info.
I am not that familiar with XML, but does it have a well-defined
typing mechanism.
It seems like an XML parser could generate the ptree with typed data.
Chris

On 9/28/06, Marcin Kalicinski <kalita_at_[hidden]> wrote:
> 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
> >


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