PhoenixLecture  2.0.0
Set of tools to make lectures
main.cpp
Go to the documentation of this file.
1 
2 /***************************************
3  Auteur : Pierre Aubert
4  Mail : pierre.aubert@lapp.in2p3.fr
5  Licence : CeCILL-C
6 ****************************************/
7 
8 #include <iostream>
9 #include "get_argument_list.h"
10 
11 
12 int main(int argc, char** argv){
13  std::list<PString> listArg = phoenix_getArgumentList(argc, argv);
14  std::cout << "Get " << listArg.size() << " arguments" << std::endl;
15  std::cout << "Is --help exist " << phoenix_isOptionExist(listArg, "--help") << std::endl;
16  std::cout << "Is --help or -h exist " << phoenix_isOptionExist(listArg, "--help", "-h") << std::endl;
17  std::cout << "String of all arguments '"<<phoenix_listArgToString(listArg)<<"'" << std::endl;
18  std::cout << "Get program call '"<<phoenix_getProgramCall(listArg)<<"'" << std::endl;
19  phoenix_rmProgramCall(listArg);
20  std::cout << "Get first argument '"<<phoenix_getProgramCall(listArg)<<"'" << std::endl;
21  std::cout << "String of all arguments without program call '"<<phoenix_listArgToString(listArg)<<"'" << std::endl;
22  return 0;
23 }
24 
25 
int main(int argc, char **argv)
Definition: main.cpp:228
void phoenix_rmProgramCall(std::list< PString > &listArg)
Remove the program call from the list of argument.
bool phoenix_isOptionExist(const std::list< PString > &listArg, const std::list< PString > &argCheckList)
Check if one of the two passed arguments are in the list of arguments.
PString phoenix_getProgramCall(const std::list< PString > &listArg)
Get the program call.
std::list< PString > phoenix_getArgumentList(int argc, char **argv)
Convert the list of given arguments to the program into a list of string.
PString phoenix_listArgToString(const std::list< PString > &listArg)
Convert the given list of arguement into a string.