Rollling 20220910

This commit is contained in:
jomjol
2022-09-10 20:19:31 +02:00
parent 3403e3ea5c
commit 79d1e6b932
13 changed files with 213 additions and 40 deletions

View File

@@ -209,6 +209,13 @@ size_t findDelimiterPos(string input, string delimiter)
return pos;
}
void DeleteFile(string fn)
{
// ESP_LOGI(logTag, "Deleting file : %s", fn.c_str());
/* Delete file */
unlink(fn.c_str());
}
void CopyFile(string input, string output)
{
@@ -245,16 +252,31 @@ void CopyFile(string input, string output)
fclose(fpTargetFile);
}
string getFileFullFileName(string filename)
{
size_t lastpos = filename.find_last_of("/", 0);
if (lastpos == string::npos)
return "";
string zw = filename.substr(lastpos + 1, filename.size() - lastpos);
zw = toUpper(zw);
return zw;
}
string getFileType(string filename)
{
int lastpos = filename.find(".", 0);
int neu_pos;
size_t lastpos = filename.find(".", 0);
size_t neu_pos;
while ((neu_pos = filename.find(".", lastpos + 1)) > -1)
{
lastpos = neu_pos;
}
if (lastpos == string::npos)
return "";
string zw = filename.substr(lastpos + 1, filename.size() - lastpos);
zw = toUpper(zw);