ToolDAQFramework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
helper_string.h
Go to the documentation of this file.
1 
12 // These are helper functions for the SDK samples (string parsing, timers, etc)
13 #ifndef STRING_HELPER_H
14 #define STRING_HELPER_H
15 
16 #include <stdio.h>
17 #include <stdlib.h>
18 #include <fstream>
19 #include <string>
20 
21 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
22 #ifndef _CRT_SECURE_NO_DEPRECATE
23 #define _CRT_SECURE_NO_DEPRECATE
24 #endif
25 #ifndef STRCASECMP
26 #define STRCASECMP _stricmp
27 #endif
28 #ifndef STRNCASECMP
29 #define STRNCASECMP _strnicmp
30 #endif
31 #ifndef STRCPY
32 #define STRCPY(sFilePath, nLength, sPath) strcpy_s(sFilePath, nLength, sPath)
33 #endif
34 
35 #ifndef FOPEN
36 #define FOPEN(fHandle,filename,mode) fopen_s(&fHandle, filename, mode)
37 #endif
38 #ifndef FOPEN_FAIL
39 #define FOPEN_FAIL(result) (result != 0)
40 #endif
41 #ifndef SSCANF
42 #define SSCANF sscanf_s
43 #endif
44 #ifndef SPRINTF
45 #define SPRINTF sprintf_s
46 #endif
47 #else // Linux Includes
48 #include <string.h>
49 #include <strings.h>
50 
51 #ifndef STRCASECMP
52 #define STRCASECMP strcasecmp
53 #endif
54 #ifndef STRNCASECMP
55 #define STRNCASECMP strncasecmp
56 #endif
57 #ifndef STRCPY
58 #define STRCPY(sFilePath, nLength, sPath) strcpy(sFilePath, sPath)
59 #endif
60 
61 #ifndef FOPEN
62 #define FOPEN(fHandle,filename,mode) (fHandle = fopen(filename, mode))
63 #endif
64 #ifndef FOPEN_FAIL
65 #define FOPEN_FAIL(result) (result == NULL)
66 #endif
67 #ifndef SSCANF
68 #define SSCANF sscanf
69 #endif
70 #ifndef SPRINTF
71 #define SPRINTF sprintf
72 #endif
73 #endif
74 
75 #ifndef EXIT_WAIVED
76 #define EXIT_WAIVED 2
77 #endif
78 
79 // CUDA Utility Helper Functions
80 inline int stringRemoveDelimiter(char delimiter, const char *string)
81 {
82  int string_start = 0;
83 
84  while (string[string_start] == delimiter)
85  {
86  string_start++;
87  }
88 
89  if (string_start >= (int)strlen(string)-1)
90  {
91  return 0;
92  }
93 
94  return string_start;
95 }
96 
97 inline int getFileExtension(char *filename, char **extension)
98 {
99  int string_length = (int)strlen(filename);
100 
101  while (filename[string_length--] != '.')
102  {
103  if (string_length == 0)
104  break;
105  }
106 
107  if (string_length > 0) string_length += 2;
108 
109  if (string_length == 0)
110  *extension = NULL;
111  else
112  *extension = &filename[string_length];
113 
114  return string_length;
115 }
116 
117 
118 inline bool checkCmdLineFlag(const int argc, const char **argv, const char *string_ref)
119 {
120  bool bFound = false;
121 
122  if (argc >= 1)
123  {
124  for (int i=1; i < argc; i++)
125  {
126  int string_start = stringRemoveDelimiter('-', argv[i]);
127  const char *string_argv = &argv[i][string_start];
128 
129  const char *equal_pos = strchr(string_argv, '=');
130  int argv_length = (int)(equal_pos == 0 ? strlen(string_argv) : equal_pos - string_argv);
131 
132  int length = (int)strlen(string_ref);
133 
134  if (length == argv_length && !STRNCASECMP(string_argv, string_ref, length))
135  {
136  bFound = true;
137  continue;
138  }
139  }
140  }
141 
142  return bFound;
143 }
144 
145 // This function wraps the CUDA Driver API into a template function
146 template <class T>
147 inline bool getCmdLineArgumentValue(const int argc, const char **argv, const char *string_ref, T *value)
148 {
149  bool bFound = false;
150 
151  if (argc >= 1)
152  {
153  for (int i=1; i < argc; i++)
154  {
155  int string_start = stringRemoveDelimiter('-', argv[i]);
156  const char *string_argv = &argv[i][string_start];
157  int length = (int)strlen(string_ref);
158 
159  if (!STRNCASECMP(string_argv, string_ref, length))
160  {
161  if (length+1 <= (int)strlen(string_argv))
162  {
163  int auto_inc = (string_argv[length] == '=') ? 1 : 0;
164  *value = (T)atoi(&string_argv[length + auto_inc]);
165  }
166 
167  bFound = true;
168  i=argc;
169  }
170  }
171  }
172 
173  return bFound;
174 }
175 
176 inline int getCmdLineArgumentInt(const int argc, const char **argv, const char *string_ref)
177 {
178  bool bFound = false;
179  int value = -1;
180 
181  if (argc >= 1)
182  {
183  for (int i=1; i < argc; i++)
184  {
185  int string_start = stringRemoveDelimiter('-', argv[i]);
186  const char *string_argv = &argv[i][string_start];
187  int length = (int)strlen(string_ref);
188 
189  if (!STRNCASECMP(string_argv, string_ref, length))
190  {
191  if (length+1 <= (int)strlen(string_argv))
192  {
193  int auto_inc = (string_argv[length] == '=') ? 1 : 0;
194  value = atoi(&string_argv[length + auto_inc]);
195  }
196  else
197  {
198  value = 0;
199  }
200 
201  bFound = true;
202  continue;
203  }
204  }
205  }
206 
207  if (bFound)
208  {
209  return value;
210  }
211  else
212  {
213  return 0;
214  }
215 }
216 
217 inline float getCmdLineArgumentFloat(const int argc, const char **argv, const char *string_ref)
218 {
219  bool bFound = false;
220  float value = -1;
221 
222  if (argc >= 1)
223  {
224  for (int i=1; i < argc; i++)
225  {
226  int string_start = stringRemoveDelimiter('-', argv[i]);
227  const char *string_argv = &argv[i][string_start];
228  int length = (int)strlen(string_ref);
229 
230  if (!STRNCASECMP(string_argv, string_ref, length))
231  {
232  if (length+1 <= (int)strlen(string_argv))
233  {
234  int auto_inc = (string_argv[length] == '=') ? 1 : 0;
235  value = (float)atof(&string_argv[length + auto_inc]);
236  }
237  else
238  {
239  value = 0.f;
240  }
241 
242  bFound = true;
243  continue;
244  }
245  }
246  }
247 
248  if (bFound)
249  {
250  return value;
251  }
252  else
253  {
254  return 0;
255  }
256 }
257 
258 inline bool getCmdLineArgumentString(const int argc, const char **argv,
259  const char *string_ref, char **string_retval)
260 {
261  bool bFound = false;
262 
263  if (argc >= 1)
264  {
265  for (int i=1; i < argc; i++)
266  {
267  int string_start = stringRemoveDelimiter('-', argv[i]);
268  char *string_argv = (char *)&argv[i][string_start];
269  int length = (int)strlen(string_ref);
270 
271  if (!STRNCASECMP(string_argv, string_ref, length))
272  {
273  *string_retval = &string_argv[length+1];
274  bFound = true;
275  continue;
276  }
277  }
278  }
279 
280  if (!bFound)
281  {
282  *string_retval = NULL;
283  }
284 
285  return bFound;
286 }
287 
296 inline char *sdkFindFilePath(const char *filename, const char *executable_path)
297 {
298  // <executable_name> defines a variable that is replaced with the name of the executable
299 
300  // Typical relative search paths to locate needed companion files (e.g. sample input data, or JIT source files)
301  // The origin for the relative search may be the .exe file, a .bat file launching an .exe, a browser .exe launching the .exe or .bat, etc
302  const char *searchPath[] =
303  {
304  "./", // same dir
305  "./common/", // "/common/" subdir
306  "./common/data/", // "/common/data/" subdir
307  "./data/", // "/data/" subdir
308  "./src/", // "/src/" subdir
309  "./src/<executable_name>/data/", // "/src/<executable_name>/data/" subdir
310  "./inc/", // "/inc/" subdir
311  "./0_Simple/", // "/0_Simple/" subdir
312  "./1_Utilities/", // "/1_Utilities/" subdir
313  "./2_Graphics/", // "/2_Graphics/" subdir
314  "./3_Imaging/", // "/3_Imaging/" subdir
315  "./4_Finance/", // "/4_Finance/" subdir
316  "./5_Simulations/", // "/5_Simulations/" subdir
317  "./6_Advanced/", // "/6_Advanced/" subdir
318  "./7_CUDALibraries/", // "/7_CUDALibraries/" subdir
319  "./8_Android/", // "/8_Android/" subdir
320  "./samples/", // "/samples/" subdir
321 
322  "../", // up 1 in tree
323  "../common/", // up 1 in tree, "/common/" subdir
324  "../common/data/", // up 1 in tree, "/common/data/" subdir
325  "../data/", // up 1 in tree, "/data/" subdir
326  "../src/", // up 1 in tree, "/src/" subdir
327  "../inc/", // up 1 in tree, "/inc/" subdir
328 
329  "../0_Simple/<executable_name>/data/", // up 1 in tree, "/0_Simple/<executable_name>/" subdir
330  "../1_Utilities/<executable_name>/data/", // up 1 in tree, "/1_Utilities/<executable_name>/" subdir
331  "../2_Graphics/<executable_name>/data/", // up 1 in tree, "/2_Graphics/<executable_name>/" subdir
332  "../3_Imaging/<executable_name>/data/", // up 1 in tree, "/3_Imaging/<executable_name>/" subdir
333  "../4_Finance/<executable_name>/data/", // up 1 in tree, "/4_Finance/<executable_name>/" subdir
334  "../5_Simulations/<executable_name>/data/", // up 1 in tree, "/5_Simulations/<executable_name>/" subdir
335  "../6_Advanced/<executable_name>/data/", // up 1 in tree, "/6_Advanced/<executable_name>/" subdir
336  "../7_CUDALibraries/<executable_name>/data/",// up 1 in tree, "/7_CUDALibraries/<executable_name>/" subdir
337  "../8_Android/<executable_name>/data/", // up 1 in tree, "/8_Android/<executable_name>/" subdir
338  "../samples/<executable_name>/data/", // up 1 in tree, "/samples/<executable_name>/" subdir
339  "../../", // up 2 in tree
340  "../../common/", // up 2 in tree, "/common/" subdir
341  "../../common/data/", // up 2 in tree, "/common/data/" subdir
342  "../../data/", // up 2 in tree, "/data/" subdir
343  "../../src/", // up 2 in tree, "/src/" subdir
344  "../../inc/", // up 2 in tree, "/inc/" subdir
345  "../../sandbox/<executable_name>/data/", // up 2 in tree, "/sandbox/<executable_name>/" subdir
346  "../../0_Simple/<executable_name>/data/", // up 2 in tree, "/0_Simple/<executable_name>/" subdir
347  "../../1_Utilities/<executable_name>/data/", // up 2 in tree, "/1_Utilities/<executable_name>/" subdir
348  "../../2_Graphics/<executable_name>/data/", // up 2 in tree, "/2_Graphics/<executable_name>/" subdir
349  "../../3_Imaging/<executable_name>/data/", // up 2 in tree, "/3_Imaging/<executable_name>/" subdir
350  "../../4_Finance/<executable_name>/data/", // up 2 in tree, "/4_Finance/<executable_name>/" subdir
351  "../../5_Simulations/<executable_name>/data/", // up 2 in tree, "/5_Simulations/<executable_name>/" subdir
352  "../../6_Advanced/<executable_name>/data/", // up 2 in tree, "/6_Advanced/<executable_name>/" subdir
353  "../../7_CUDALibraries/<executable_name>/data/", // up 2 in tree, "/7_CUDALibraries/<executable_name>/" subdir
354  "../../8_Android/<executable_name>/data/", // up 2 in tree, "/8_Android/<executable_name>/" subdir
355  "../../samples/<executable_name>/data/", // up 2 in tree, "/samples/<executable_name>/" subdir
356  "../../../", // up 3 in tree
357  "../../../src/<executable_name>/", // up 3 in tree, "/src/<executable_name>/" subdir
358  "../../../src/<executable_name>/data/", // up 3 in tree, "/src/<executable_name>/data/" subdir
359  "../../../src/<executable_name>/src/", // up 3 in tree, "/src/<executable_name>/src/" subdir
360  "../../../src/<executable_name>/inc/", // up 3 in tree, "/src/<executable_name>/inc/" subdir
361  "../../../sandbox/<executable_name>/", // up 3 in tree, "/sandbox/<executable_name>/" subdir
362  "../../../sandbox/<executable_name>/data/", // up 3 in tree, "/sandbox/<executable_name>/data/" subdir
363  "../../../sandbox/<executable_name>/src/", // up 3 in tree, "/sandbox/<executable_name>/src/" subdir
364  "../../../sandbox/<executable_name>/inc/", // up 3 in tree, "/sandbox/<executable_name>/inc/" subdir
365  "../../../0_Simple/<executable_name>/data/", // up 3 in tree, "/0_Simple/<executable_name>/" subdir
366  "../../../1_Utilities/<executable_name>/data/", // up 3 in tree, "/1_Utilities/<executable_name>/" subdir
367  "../../../2_Graphics/<executable_name>/data/", // up 3 in tree, "/2_Graphics/<executable_name>/" subdir
368  "../../../3_Imaging/<executable_name>/data/", // up 3 in tree, "/3_Imaging/<executable_name>/" subdir
369  "../../../4_Finance/<executable_name>/data/", // up 3 in tree, "/4_Finance/<executable_name>/" subdir
370  "../../../5_Simulations/<executable_name>/data/", // up 3 in tree, "/5_Simulations/<executable_name>/" subdir
371  "../../../6_Advanced/<executable_name>/data/", // up 3 in tree, "/6_Advanced/<executable_name>/" subdir
372  "../../../7_CUDALibraries/<executable_name>/data/", // up 3 in tree, "/7_CUDALibraries/<executable_name>/" subdir
373  "../../../8_Android/<executable_name>/data/", // up 3 in tree, "/8_Android/<executable_name>/" subdir
374  "../../../0_Simple/<executable_name>/", // up 3 in tree, "/0_Simple/<executable_name>/" subdir
375  "../../../1_Utilities/<executable_name>/", // up 3 in tree, "/1_Utilities/<executable_name>/" subdir
376  "../../../2_Graphics/<executable_name>/", // up 3 in tree, "/2_Graphics/<executable_name>/" subdir
377  "../../../3_Imaging/<executable_name>/", // up 3 in tree, "/3_Imaging/<executable_name>/" subdir
378  "../../../4_Finance/<executable_name>/", // up 3 in tree, "/4_Finance/<executable_name>/" subdir
379  "../../../5_Simulations/<executable_name>/", // up 3 in tree, "/5_Simulations/<executable_name>/" subdir
380  "../../../6_Advanced/<executable_name>/", // up 3 in tree, "/6_Advanced/<executable_name>/" subdir
381  "../../../7_CUDALibraries/<executable_name>/", // up 3 in tree, "/7_CUDALibraries/<executable_name>/" subdir
382  "../../../8_Android/<executable_name>/", // up 3 in tree, "/8_Android/<executable_name>/" subdir
383  "../../../samples/<executable_name>/data/", // up 3 in tree, "/samples/<executable_name>/" subdir
384  "../../../common/", // up 3 in tree, "../../../common/" subdir
385  "../../../common/data/", // up 3 in tree, "../../../common/data/" subdir
386  "../../../data/", // up 3 in tree, "../../../data/" subdir
387  "../../../../", // up 4 in tree
388  "../../../../src/<executable_name>/", // up 4 in tree, "/src/<executable_name>/" subdir
389  "../../../../src/<executable_name>/data/", // up 4 in tree, "/src/<executable_name>/data/" subdir
390  "../../../../src/<executable_name>/src/", // up 4 in tree, "/src/<executable_name>/src/" subdir
391  "../../../../src/<executable_name>/inc/", // up 4 in tree, "/src/<executable_name>/inc/" subdir
392  "../../../../sandbox/<executable_name>/", // up 4 in tree, "/sandbox/<executable_name>/" subdir
393  "../../../../sandbox/<executable_name>/data/", // up 4 in tree, "/sandbox/<executable_name>/data/" subdir
394  "../../../../sandbox/<executable_name>/src/", // up 4 in tree, "/sandbox/<executable_name>/src/" subdir
395  "../../../../sandbox/<executable_name>/inc/", // up 4 in tree, "/sandbox/<executable_name>/inc/" subdir
396  "../../../../0_Simple/<executable_name>/data/", // up 4 in tree, "/0_Simple/<executable_name>/" subdir
397  "../../../../1_Utilities/<executable_name>/data/", // up 4 in tree, "/1_Utilities/<executable_name>/" subdir
398  "../../../../2_Graphics/<executable_name>/data/", // up 4 in tree, "/2_Graphics/<executable_name>/" subdir
399  "../../../../3_Imaging/<executable_name>/data/", // up 4 in tree, "/3_Imaging/<executable_name>/" subdir
400  "../../../../4_Finance/<executable_name>/data/", // up 4 in tree, "/4_Finance/<executable_name>/" subdir
401  "../../../../5_Simulations/<executable_name>/data/",// up 4 in tree, "/5_Simulations/<executable_name>/" subdir
402  "../../../../6_Advanced/<executable_name>/data/", // up 4 in tree, "/6_Advanced/<executable_name>/" subdir
403  "../../../../7_CUDALibraries/<executable_name>/data/", // up 4 in tree, "/7_CUDALibraries/<executable_name>/" subdir
404  "../../../../8_Android/<executable_name>/data/", // up 4 in tree, "/8_Android/<executable_name>/" subdir
405  "../../../../0_Simple/<executable_name>/", // up 4 in tree, "/0_Simple/<executable_name>/" subdir
406  "../../../../1_Utilities/<executable_name>/", // up 4 in tree, "/1_Utilities/<executable_name>/" subdir
407  "../../../../2_Graphics/<executable_name>/", // up 4 in tree, "/2_Graphics/<executable_name>/" subdir
408  "../../../../3_Imaging/<executable_name>/", // up 4 in tree, "/3_Imaging/<executable_name>/" subdir
409  "../../../../4_Finance/<executable_name>/", // up 4 in tree, "/4_Finance/<executable_name>/" subdir
410  "../../../../5_Simulations/<executable_name>/",// up 4 in tree, "/5_Simulations/<executable_name>/" subdir
411  "../../../../6_Advanced/<executable_name>/", // up 4 in tree, "/6_Advanced/<executable_name>/" subdir
412  "../../../../7_CUDALibraries/<executable_name>/", // up 4 in tree, "/7_CUDALibraries/<executable_name>/" subdir
413  "../../../../8_Android/<executable_name>/", // up 4 in tree, "/8_Android/<executable_name>/" subdir
414  "../../../../samples/<executable_name>/data/", // up 4 in tree, "/samples/<executable_name>/" subdir
415  "../../../../common/", // up 4 in tree, "../../../common/" subdir
416  "../../../../common/data/", // up 4 in tree, "../../../common/data/" subdir
417  "../../../../data/", // up 4 in tree, "../../../data/" subdir
418  "../../../../../", // up 5 in tree
419  "../../../../../src/<executable_name>/", // up 5 in tree, "/src/<executable_name>/" subdir
420  "../../../../../src/<executable_name>/data/", // up 5 in tree, "/src/<executable_name>/data/" subdir
421  "../../../../../src/<executable_name>/src/", // up 5 in tree, "/src/<executable_name>/src/" subdir
422  "../../../../../src/<executable_name>/inc/", // up 5 in tree, "/src/<executable_name>/inc/" subdir
423  "../../../../../sandbox/<executable_name>/", // up 5 in tree, "/sandbox/<executable_name>/" subdir
424  "../../../../../sandbox/<executable_name>/data/", // up 5 in tree, "/sandbox/<executable_name>/data/" subdir
425  "../../../../../sandbox/<executable_name>/src/", // up 5 in tree, "/sandbox/<executable_name>/src/" subdir
426  "../../../../../sandbox/<executable_name>/inc/", // up 5 in tree, "/sandbox/<executable_name>/inc/" subdir
427  "../../../../../0_Simple/<executable_name>/data/", // up 5 in tree, "/0_Simple/<executable_name>/" subdir
428  "../../../../../1_Utilities/<executable_name>/data/", // up 5 in tree, "/1_Utilities/<executable_name>/" subdir
429  "../../../../../2_Graphics/<executable_name>/data/", // up 5 in tree, "/2_Graphics/<executable_name>/" subdir
430  "../../../../../3_Imaging/<executable_name>/data/", // up 5 in tree, "/3_Imaging/<executable_name>/" subdir
431  "../../../../../4_Finance/<executable_name>/data/", // up 5 in tree, "/4_Finance/<executable_name>/" subdir
432  "../../../../../5_Simulations/<executable_name>/data/",// up 5 in tree, "/5_Simulations/<executable_name>/" subdir
433  "../../../../../6_Advanced/<executable_name>/data/", // up 5 in tree, "/6_Advanced/<executable_name>/" subdir
434  "../../../../../7_CUDALibraries/<executable_name>/data/", // up 5 in tree, "/7_CUDALibraries/<executable_name>/" subdir
435  "../../../../../8_Android/<executable_name>/data/", // up 5 in tree, "/8_Android/<executable_name>/" subdir
436  "../../../../../samples/<executable_name>/data/", // up 5 in tree, "/samples/<executable_name>/" subdir
437  "../../../../../common/", // up 5 in tree, "../../../common/" subdir
438  "../../../../../common/data/", // up 5 in tree, "../../../common/data/" subdir
439  };
440 
441  // Extract the executable name
442  std::string executable_name;
443 
444  if (executable_path != 0)
445  {
446  executable_name = std::string(executable_path);
447 
448 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
449  // Windows path delimiter
450  size_t delimiter_pos = executable_name.find_last_of('\\');
451  executable_name.erase(0, delimiter_pos + 1);
452 
453  if (executable_name.rfind(".exe") != std::string::npos)
454  {
455  // we strip .exe, only if the .exe is found
456  executable_name.resize(executable_name.size() - 4);
457  }
458 
459 #else
460  // Linux & OSX path delimiter
461  size_t delimiter_pos = executable_name.find_last_of('/');
462  executable_name.erase(0,delimiter_pos+1);
463 #endif
464  }
465 
466  // Loop over all search paths and return the first hit
467  for (unsigned int i = 0; i < sizeof(searchPath)/sizeof(char *); ++i)
468  {
469  std::string path(searchPath[i]);
470  size_t executable_name_pos = path.find("<executable_name>");
471 
472  // If there is executable_name variable in the searchPath
473  // replace it with the value
474  if (executable_name_pos != std::string::npos)
475  {
476  if (executable_path != 0)
477  {
478  path.replace(executable_name_pos, strlen("<executable_name>"), executable_name);
479  }
480  else
481  {
482  // Skip this path entry if no executable argument is given
483  continue;
484  }
485  }
486 
487 #ifdef _DEBUG
488  printf("sdkFindFilePath <%s> in %s\n", filename, path.c_str());
489 #endif
490 
491  // Test if the file exists
492  path.append(filename);
493  FILE *fp;
494  FOPEN(fp, path.c_str(), "rb");
495 
496  if (fp != NULL)
497  {
498  fclose(fp);
499  // File found
500  // returning an allocated array here for backwards compatibility reasons
501  char *file_path = (char *) malloc(path.length() + 1);
502  STRCPY(file_path, path.length() + 1, path.c_str());
503  return file_path;
504  }
505 
506  if (fp)
507  {
508  fclose(fp);
509  }
510  }
511 
512  // File not found
513  return 0;
514 }
515 
516 #endif
#define STRNCASECMP
Definition: helper_string.h:55
int stringRemoveDelimiter(char delimiter, const char *string)
Definition: helper_string.h:80
bool checkCmdLineFlag(const int argc, const char **argv, const char *string_ref)
#define FOPEN(fHandle, filename, mode)
Definition: helper_string.h:62
bool getCmdLineArgumentString(const int argc, const char **argv, const char *string_ref, char **string_retval)
int getFileExtension(char *filename, char **extension)
Definition: helper_string.h:97
char * sdkFindFilePath(const char *filename, const char *executable_path)
bool getCmdLineArgumentValue(const int argc, const char **argv, const char *string_ref, T *value)
#define STRCPY(sFilePath, nLength, sPath)
Definition: helper_string.h:58
int getCmdLineArgumentInt(const int argc, const char **argv, const char *string_ref)
float getCmdLineArgumentFloat(const int argc, const char **argv, const char *string_ref)