25 #ifndef YCommandLine_h 26 #define YCommandLine_h 75 std::string
arg(
int index )
const;
86 {
return arg( index ); }
91 void add(
const std::string & arg );
98 void remove(
int index );
105 void replace(
int index,
const std::string & arg );
114 int find(
const std::string & argName )
const;
123 #endif // YCommandLine_h int find(const std::string &argName) const
Find a command line argument 'argName' ("-display" etc.).
~YCommandLine()
Destructor.
int size() const
Alias for argc() for those who like a more C++ -like syntax.
YCommandLine()
Constructor.
std::string operator[](int index) const
Return command line argument no.
void replace(int index, const std::string &arg)
Replace command line argument no.
Utility class to access /proc/<pid>/cmdline to retrieve argc and argv.
char ** argv() const
Return the arguments in a C compatible fashion: An array of pointers to characters.
void add(const std::string &arg)
Add a command line argument (at the end of the existing ones).
int argc() const
Return the number of arguments in the command line.
std::string arg(int index) const
Return command line argument no.