program_option: comment récuperer les informations?
Bonjour,
je veux rentrer plusieurs fichiers en input(3 dans mon exemple en argument), je ne sais pas comment les récupérer séparément:
--I testO.txt
--I workspace/FloatToFix/iir_light2.xml
--I workspace/FloatToFix/sfg.dtd
Code:
1 2 3 4 5 6
|
po::options_description desc((char*)"Allowed options");
desc.add_options()
("help", "produce help message")
("I", po::value< vector<string> >(), "input file") |
Code:
1 2 3 4 5
| if (vm.count("include-path"))
{
cout << "Include paths are: "
<< vm["include-path"].as< vector<string> >() << "\n";
} |
me renvoie:
Citation:
Input files are: testO.txt workspace/FloatToFix/iir_light2.xml workspace/FloatToFix/sfg.dtd
Je ne trouve pas la méthode pour récuperer la string "testO.txt" seulement....
un truc du style:
Citation:
cout << "le premier est: " << vm["I"][0].as<string>() << "\n";
merci de votre aide :?