67 bool endsWith(
const char *a,
const char *suffix)
70 int sl=strlen(suffix);
71 if (al<sl)
return false;
72 const char *a_suff=&a[al-sl];
73 return 0==strcmp(a_suff,suffix);
79 FILE *f=
fopen(fName,
"rb");
95 while (i>=0 && !isdigit(cur[i])) i--;
96 if (i<0)
return false;
107 if (i<0 || !isdigit(cur[i]))
return false;
118 const int bufLen=500;
119 static char buf[bufLen];
122 for (
int i=strlen(buf);
i<bufLen;
i++) buf[
i]=
' ';
131 int dotLoc=ret.rfind(
".");
132 if (dotLoc==-1)
return ret.append(newSuffix);
133 return ret.erase(dotLoc).append(newSuffix);
bool fileExists(const char *fName)
bool incrementAscii(char *cur)
int fclose(std::FILE *file)
Close a file, and check for possible errors.
void int int int REAL REAL REAL const char * fName
bool endsWith(const char *a, const char *suffix)
string replaceExtention(const string &a, const string &newSuffix)
const char * fortranifyString(const char *src)
std::FILE * fopen(const char *const path, const char *const mode)
Open a file, and check for possible errors.