ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Macros | Functions
helper_string.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <fstream>
#include <string>
#include <string.h>
#include <strings.h>
Include dependency graph for helper_string.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

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

Functions

int stringRemoveDelimiter (char delimiter, const char *string)
 
int getFileExtension (char *filename, char **extension)
 
bool checkCmdLineFlag (const int argc, const char **argv, const char *string_ref)
 
template<class T >
bool getCmdLineArgumentValue (const int argc, const char **argv, const char *string_ref, T *value)
 
int getCmdLineArgumentInt (const int argc, const char **argv, const char *string_ref)
 
float getCmdLineArgumentFloat (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)
 
char * sdkFindFilePath (const char *filename, const char *executable_path)
 

Macro Definition Documentation

◆ EXIT_WAIVED

#define EXIT_WAIVED   2

◆ FOPEN

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

◆ FOPEN_FAIL

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

◆ SPRINTF

#define SPRINTF   sprintf

◆ SSCANF

#define SSCANF   sscanf

◆ STRCASECMP

#define STRCASECMP   strcasecmp

◆ STRCPY

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

◆ STRNCASECMP

#define STRNCASECMP   strncasecmp

Function Documentation

◆ checkCmdLineFlag()

bool checkCmdLineFlag ( const int  argc,
const char **  argv,
const char *  string_ref 
)
inline
Here is the call graph for this function:

◆ getCmdLineArgumentFloat()

float getCmdLineArgumentFloat ( const int  argc,
const char **  argv,
const char *  string_ref 
)
inline
Here is the call graph for this function:

◆ getCmdLineArgumentInt()

int getCmdLineArgumentInt ( const int  argc,
const char **  argv,
const char *  string_ref 
)
inline
Here is the call graph for this function:

◆ getCmdLineArgumentString()

bool getCmdLineArgumentString ( const int  argc,
const char **  argv,
const char *  string_ref,
char **  string_retval 
)
inline
Here is the call graph for this function:

◆ getCmdLineArgumentValue()

template<class T >
bool getCmdLineArgumentValue ( const int  argc,
const char **  argv,
const char *  string_ref,
T value 
)
inline
Here is the call graph for this function:

◆ getFileExtension()

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

◆ 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

◆ stringRemoveDelimiter()

int stringRemoveDelimiter ( char  delimiter,
const char *  string 
)
inline
Here is the caller graph for this function: