next up previous contents
Next: Direct access to command Up: GetPot Version 1.0 Powerful Previous: Flags   Contents

Nominus Arguments

In order to quickly go through the arguments that do not start with a minus, the next_nominus() function is provided. Each call to this function returns the following argument that does not have a minus. If there is no further argument, this function return '0'. Example:

     vector<string>  files;
     const char*     nm = cl.next_nominus();     
     while( nm != 0 ) {
         nm = cl.next_nominus();     
Here the nominus arguments are read one after the other into an array of strings containing some filenames. If this is all one needs, one is better of asking directly for a vector of all nominus arguments:
    vector<string>   files = cl.nominus_vector();
This line does the same as the slightly more complicated piece of code above.

Frank-Rene Schaefer 2002-09-14