Version: 9.12.0
Qtx::CmdLineArgs Class Reference

Get access to the command line arguments in the C-like manner. More...

#include <Qtx.h>

Public Member Functions

 CmdLineArgs ()
 Default constructor. More...
 
 ~CmdLineArgs ()
 Destructor. Deallocates the array with command line arguments. More...
 
int argc () const
 Get number of command line arguments. More...
 
char ** argv () const
 Get command line arguments. More...
 

Private Attributes

int myArgc
 
char ** myArgv
 

Detailed Description

Get access to the command line arguments in the C-like manner.

This class translates command line arguments stored in QApplication in form of QStrlingList to the char* array, in the same way as they specified to main() function.

Constructor of class allocates required memory to store arguments; destructor deallocates it, This allows using this class as a local variable:

some_function(args.argc(), args.argv()); // function that has main()-like syntax.
Get access to the command line arguments in the C-like manner.
Definition: Qtx.h:164
int argc() const
Get number of command line arguments.
Definition: Qtx.cxx:2391
char ** argv() const
Get command line arguments.
Definition: Qtx.cxx:2400

Constructor & Destructor Documentation

◆ CmdLineArgs()

Qtx::CmdLineArgs::CmdLineArgs ( )

Default constructor.

◆ ~CmdLineArgs()

Qtx::CmdLineArgs::~CmdLineArgs ( )

Destructor. Deallocates the array with command line arguments.

Member Function Documentation

◆ argc()

int Qtx::CmdLineArgs::argc ( ) const

Get number of command line arguments.

Returns
number of arguments

◆ argv()

char ** Qtx::CmdLineArgs::argv ( ) const

Get command line arguments.

Returns
command line arguments

Member Data Documentation

◆ myArgc

int Qtx::CmdLineArgs::myArgc
private

◆ myArgv

char** Qtx::CmdLineArgs::myArgv
private

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