Advanced Multi-Physics (AMP)
On-Line Documentation
Macros | Functions
helper_string.h File Reference
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <cuda.h>
#include <cuda_runtime.h>
#include <string.h>
#include <strings.h>
Include dependency graph for helper_string.h:

Go to the source code of this file.

Macros

#define EXIT_WAIVED   2
 
#define FOPEN(fHandle, filename, mode)   ( fHandle = fopen( filename, mode ) )
 
#define FOPEN_FAIL(result)   ( result == NULL )
 
#define SSCANF   sscanf
 
#define STRCASECMP   strcasecmp
 
#define STRCPY(sFilePath, nLength, sPath)   strcpy( sFilePath, sPath )
 
#define STRNCASECMP   strncasecmp
 

Functions

bool checkCmdLineFlag (const int argc, const char **argv, const char *string_ref)
 
float getCmdLineArgumentFloat (const int argc, const char **argv, const char *string_ref)
 
int getCmdLineArgumentInt (const int argc, const char **argv, const char *string_ref)
 
bool getCmdLineArgumentString (const int argc, const char **argv, const char *string_ref, char **string_retval)
 
template<class T >
bool getCmdLineArgumentValue (const int argc, const char **argv, const char *string_ref, T *value)
 
int getFileExtension (char *filename, char **extension)
 
char * sdkFindFilePath (const char *filename, const char *executable_path)
 
int stringRemoveDelimiter (char delimiter, const char *string)
 

Macro Definition Documentation

◆ EXIT_WAIVED

#define EXIT_WAIVED   2

Definition at line 73 of file helper_string.h.

◆ FOPEN

#define FOPEN (   fHandle,
  filename,
  mode 
)    ( fHandle = fopen( filename, mode ) )

Definition at line 62 of file helper_string.h.

◆ FOPEN_FAIL

#define FOPEN_FAIL (   result)    ( result == NULL )

Definition at line 65 of file helper_string.h.

◆ SSCANF

#define SSCANF   sscanf

Definition at line 68 of file helper_string.h.

◆ STRCASECMP

#define STRCASECMP   strcasecmp

Copyright 1993-2013 NVIDIA Corporation. All rights reserved.

Please refer to the NVIDIA end user license agreement (EULA) associated with this source code for terms and conditions that govern your use of this software. Any use, reproduction, disclosure, or distribution of this software and related documentation outside the terms of the EULA is strictly prohibited.

Definition at line 52 of file helper_string.h.

◆ STRCPY

#define STRCPY (   sFilePath,
  nLength,
  sPath 
)    strcpy( sFilePath, sPath )

Definition at line 58 of file helper_string.h.

◆ STRNCASECMP

#define STRNCASECMP   strncasecmp

Definition at line 55 of file helper_string.h.

Function Documentation

◆ checkCmdLineFlag()

bool checkCmdLineFlag ( const int  argc,
const char **  argv,
const char *  string_ref 
)
inline

Definition at line 113 of file helper_string.h.

References stringRemoveDelimiter(), and STRNCASECMP.

◆ getCmdLineArgumentFloat()

float getCmdLineArgumentFloat ( const int  argc,
const char **  argv,
const char *  string_ref 
)
inline

Definition at line 198 of file helper_string.h.

References stringRemoveDelimiter(), and STRNCASECMP.

◆ getCmdLineArgumentInt()

int getCmdLineArgumentInt ( const int  argc,
const char **  argv,
const char *  string_ref 
)
inline

Definition at line 166 of file helper_string.h.

References stringRemoveDelimiter(), and STRNCASECMP.

◆ getCmdLineArgumentString()

bool getCmdLineArgumentString ( const int  argc,
const char **  argv,
const char *  string_ref,
char **  string_retval 
)
inline

Definition at line 230 of file helper_string.h.

References stringRemoveDelimiter(), and STRNCASECMP.

◆ getCmdLineArgumentValue()

template<class T >
bool getCmdLineArgumentValue ( const int  argc,
const char **  argv,
const char *  string_ref,
T *  value 
)
inline

Definition at line 141 of file helper_string.h.

References stringRemoveDelimiter(), and STRNCASECMP.

◆ getFileExtension()

int getFileExtension ( char *  filename,
char **  extension 
)
inline

Definition at line 92 of file helper_string.h.

◆ sdkFindFilePath()

char * sdkFindFilePath ( const char *  filename,
const char *  executable_path 
)
inline

Find the path for a file assuming that files are found in the searchPath.

Returns
the path if succeeded, otherwise 0
Parameters
filenamename of the file
executable_pathoptional absolute path of the executable

Definition at line 266 of file helper_string.h.

References FOPEN, and STRCPY.

◆ stringRemoveDelimiter()

int stringRemoveDelimiter ( char  delimiter,
const char *  string 
)
inline



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:41.
Comments on this page