Boost logo

Boost Users :

From: Christoph Duelli (duelli_at_[hidden])
Date: 2006-05-19 03:16:36

I am trying to parse my options into a QString.
I have provided streaming operators for QString, so code like the following
does compile

QString sProgram;
  ("program,p", po::value<QString>(&sProgram), "...");

It does even work if I pass 'simple' options:
-p test will work
-p "test oops" will not
The cause for that seems to be that the lexical_cast<QString>("test oops")
(in program_options) fails (it does fail).
If I use std::string the above does work.

Seems providing streaming ops was not enough.
  QString s;
  "a b" >> s;
  now s=="a"
lexical_cast has special support for string/wstring according to its docs. I
need something similar for QString...
Can anyone point me in the right direction? Can I (and how) make
lexical_cast treat QStrings like regular std::strings?

Thanks for any help,

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at