FflasFfpack
Data Structures | Namespaces | Macros | Enumerations | Functions
args-parser.h File Reference
#include <fflas-ffpack/fflas-ffpack-config.h>
#include <givaro/givinteger.h>
#include <givaro/givprint.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cstring>
#include <list>
#include <stdlib.h>

Data Structures

struct  Argument
 

Namespaces

namespace  FFLAS
 

Macros

#define TYPE_BOOL   TYPE_NONE
 
#define END_OF_ARGUMENTS   { '\0', "\0", "\0", TYPE_NONE, NULL }
 
#define type_integer   long int
 

Enumerations

enum  ArgumentType {
  TYPE_NONE , TYPE_INT , TYPE_UINT64 , TYPE_LONGLONG ,
  TYPE_INTEGER , TYPE_DOUBLE , TYPE_INTLIST , TYPE_STR
}
 

Functions

void parseArguments (int argc, char **argv, Argument *args, bool printDefaults=true)
 
void printHelpMessage (const char *program, Argument *args, bool printDefaults=false)
 
ArgumentfindArgument (Argument *args, char c)
 
int getListArgs (std::list< int > &outlist, std::string &instring)
 transforms a string list of ints to a list of int string "12,13,15" is turned into list of ints {12,13,15} More...
 
char * getArgumentValue (int argc, char **argv, int i)
 Get the value of an argument and avoid core dump when no value was given after an argument. More...
 
std::ostream & writeCommandString (std::ostream &os, Argument *args, const char *programName=nullptr)
 writes the values of all arguments, preceded by the programName More...
 

Macro Definition Documentation

◆ TYPE_BOOL

#define TYPE_BOOL   TYPE_NONE

◆ END_OF_ARGUMENTS

#define END_OF_ARGUMENTS   { '\0', "\0", "\0", TYPE_NONE, NULL }

◆ type_integer

#define type_integer   long int

Enumeration Type Documentation

◆ ArgumentType

Enumerator
TYPE_NONE 
TYPE_INT 
TYPE_UINT64 
TYPE_LONGLONG 
TYPE_INTEGER 
TYPE_DOUBLE 
TYPE_INTLIST 
TYPE_STR 

Function Documentation

◆ printHelpMessage()

void printHelpMessage ( const char *  program,
Argument args,
bool  printDefaults = false 
)

◆ findArgument()

Argument * findArgument ( Argument args,
char  c 
)

◆ getListArgs()

int getListArgs ( std::list< int > &  outlist,
std::string &  instring 
)

transforms a string list of ints to a list of int string "12,13,15" is turned into list of ints {12,13,15}

 

Parameters
outlistlist once converted
instringlist to be converted
Returns
status message.