IDL compiler front-end library
Public Member Functions | List of all members
IDL_FrontEnd::CmdLine Class Reference

Command line argument iterator. More...

#include <IDL_FrontEnd.h>

Public Member Functions

const char * arg () const noexcept
 
bool end () const noexcept
 
bool next () noexcept
 Advances to the next argument. More...
 
const char * parameter (const char *switch_end)
 Get the parameter followed to the switch. More...
 
 CmdLine (int argc, const char *const argv[])
 

Detailed Description

Command line argument iterator.

Definition at line 116 of file IDL_FrontEnd.h.

Constructor & Destructor Documentation

◆ CmdLine()

IDL_FrontEnd::CmdLine::CmdLine ( int  argc,
const char *const  argv[] 
)
inline

Constructor.

Parameters
argcArgument count.
argvArgument array.

Definition at line 151 of file IDL_FrontEnd.h.

Member Function Documentation

◆ arg()

const char* IDL_FrontEnd::CmdLine::arg ( ) const
inlinenoexcept
Returns
The current argument

Definition at line 120 of file IDL_FrontEnd.h.

◆ end()

bool IDL_FrontEnd::CmdLine::end ( ) const
inlinenoexcept
Returns
false if there are no more arguments.

Definition at line 127 of file IDL_FrontEnd.h.

◆ next()

bool IDL_FrontEnd::CmdLine::next ( )
noexcept

Advances to the next argument.

Returns
true on success, false if no more arguments.

◆ parameter()

const char* IDL_FrontEnd::CmdLine::parameter ( const char *  switch_end)

Get the parameter followed to the switch.

The command line parameter may follow the switch immediately (-DMYDEFINE) or as the next argument (-D MYDEFINE). The parameter must not start from '-'.

Parameters
switch_endPointer to the character immediately after the switch.
Returns
The parameter string.
Exceptions
std::invalid_argumentif the parameter is missing.

The documentation for this class was generated from the following file: