GraphTool
 All Classes Files Functions Variables Typedefs
Functions
main.h File Reference
#include <vector>
#include <string>
#include <Graph.h>

Go to the source code of this file.

Functions

void justifyText (const string &text, int pageWidth, int indent)
 
vector< string > getValues (string option, vector< string > args)
 
string getFileExtension (string filename)
 
vector< string > replaceLongWithShortNames (vector< string > args)
 
vector< string > getUsedOptionsFromArg (const vector< string > &allArgs)
 
void printv (const char *fstr,...)
 
void showHelp (void)
 
void checkNumberOfRequiredArguments (string option, vector< string > optionValues)
 
bool hasOnlyDigits (const string s)
 
vector< string > getAllArgs (int argc, char **argv)
 
int str2int (string number)
 
void call_getInDeg (const vector< string > &allArgs, Graph *currentGraph)
 
void call_getNumberOfNodes (const vector< string > &allArgs, Graph *currentGraph)
 
void call_getNumberOfEdges (const vector< string > &allArgs, Graph *currentGraph)
 
void call_hasCycle (const vector< string > &allArgs, Graph *currentGraph)
 
void call_isComplete (const vector< string > &allArgs, Graph *currentGraph)
 
void call_isForest (const vector< string > &allArgs, Graph *currentGraph)
 
void call_isDirected (const vector< string > &allArgs, Graph *currentGraph)
 
void call_isFreeOfLoops (const vector< string > &allArgs, Graph *currentGraph)
 
void call_isMultigraph (const vector< string > &allArgs, Graph *currentGraph)
 
void call_isRegular (const vector< string > &allArgs, Graph *currentGraph)
 
void call_isSimple (const vector< string > &allArgs, Graph *currentGraph)
 
void call_getOutDeg (const vector< string > &allArgs, Graph *currentGraph)
 
void call_areNeighbours (const vector< string > &allArgs, Graph *currentGraph)
 
void call_hasConnectivity (const vector< string > &allArgs, Graph *currentGraph)
 
void call_hasEdge (const vector< string > &allArgs, Graph *currentGraph)
 
void call_hasPath (const vector< string > &allArgs, Graph *currentGraph)
 

Function Documentation

void call_areNeighbours ( const vector< string > &  allArgs,
Graph currentGraph 
)
void call_getInDeg ( const vector< string > &  allArgs,
Graph currentGraph 
)
void call_getNumberOfEdges ( const vector< string > &  allArgs,
Graph currentGraph 
)
void call_getNumberOfNodes ( const vector< string > &  allArgs,
Graph currentGraph 
)
void call_getOutDeg ( const vector< string > &  allArgs,
Graph currentGraph 
)
void call_hasConnectivity ( const vector< string > &  allArgs,
Graph currentGraph 
)
void call_hasCycle ( const vector< string > &  allArgs,
Graph currentGraph 
)
void call_hasEdge ( const vector< string > &  allArgs,
Graph currentGraph 
)
void call_hasPath ( const vector< string > &  allArgs,
Graph currentGraph 
)
void call_isComplete ( const vector< string > &  allArgs,
Graph currentGraph 
)
void call_isDirected ( const vector< string > &  allArgs,
Graph currentGraph 
)
void call_isForest ( const vector< string > &  allArgs,
Graph currentGraph 
)
void call_isFreeOfLoops ( const vector< string > &  allArgs,
Graph currentGraph 
)
void call_isMultigraph ( const vector< string > &  allArgs,
Graph currentGraph 
)
void call_isRegular ( const vector< string > &  allArgs,
Graph currentGraph 
)
void call_isSimple ( const vector< string > &  allArgs,
Graph currentGraph 
)
void checkNumberOfRequiredArguments ( string  option,
vector< string >  optionValues 
)

checks whether there are enough arguments for a certain option.

Parameters
optionthe option
optionValuesits values
vector<string> getAllArgs ( int  argc,
char **  argv 
)

converts the program arguments to one arry

Parameters
argcargument count
argvarguments
Returns
array with all arguments
string getFileExtension ( string  filename)

Returns the extension of a filename.

Parameters
filenamethe filename
Returns
the file ext.
vector<string> getUsedOptionsFromArg ( const vector< string > &  allArgs)

Extracts als used options in arguments.

Parameters
allArgsall program arguments
Returns
an array of all options
vector<string> getValues ( string  option,
vector< string >  args 
)

Extracts all values corresponding to a given option.

e.g. we have a command line like "-a foo1 foo2 foo3 -b ffoo" and call getOptionValues("a", "-a foo1 foo2 foo3 -b ffoo") ==> returns an array with {"foo1", "foo2", "foo3"}

checks only short names of options!

Parameters
optionan option
argsall arguments (from main **argv)
Returns
an array with all values of the given option
bool hasOnlyDigits ( const string  s)

checks whether a string contains only digits

Parameters
sthe string
Returns
true, if string only contains digits
void justifyText ( const string &  text,
int  pageWidth,
int  indent 
)

justifies the given text.

Parameters
textthe text
pageWidththe page width
indentthe indention
void printv ( const char *  fstr,
  ... 
)

Printf wrapper for verbose mode. Prints a formatted string and the corresponding number of values.

Parameters
strformatted string
vector<string> replaceLongWithShortNames ( vector< string >  args)

Replace all long name options with their corresponding short name

Parameters
argsarray with arguments
Returns
array with shorten options
void showHelp ( void  )

prints out the help page.

int str2int ( string  number)

Converts a string to a int

Parameters
numberstring with a number ([0-9]*)
Returns
string as int