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;
desc.add_options()
  ("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,
Christoph


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