Boost logo

Boost :

From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2002-01-23 13:20:25

----- Original Message -----
From: Vladimir Prus <ghost_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, January 23, 2002 3:04 PM
Subject: Re: [boost] environment variable access

> Fernando Cacciola wrote:
> > I'll drop in out of context because I considered once something that
> > be relevant to this thread.
> > Accessing environment variables has a LOT in common with accessing
> > registry or configuration file variables.
> True. And it has a lot of common with command line options. Some time ago
> found it quite convenient to have config file and command line to work
> together: config file has many options and command line can override some
> them.
Yes, I forgot about command line options.

> > Could it be possible that the people working on this consider a
> > external source variable accessing framework?
> > Would this be too much of a burden?
> >
> > I'm thinking about something that would look like:
> >
> > string location = external::get(env(),"LOCATION", "c:/");
> > string user = external::get(registry(),"UserName", "c:/");
> What I'd like (and what I'm trying to implement in command line/config
> parser) is map like interface. So that one could be able to say
> environment["http_proxy"].as<ip_address>()
> where "as" method is a shortcut to lexical_cast/any_cast.
This interface looks interesting.
I guess that 'string' would be a good (safe) default type, so that:


returns a proxy that can be implicitly converted to a string,
and if concatenated with 'as<>' translate the string using lexical_cast<>.

This proxy could also provide, environment["http_proxy"].exist(), for

Fernando Cacciola
Sierra s.r.l.

Boost list run by bdawes at, gregod at, cpdaniel at, john at