Improve initial setup proc (#1692)

* Initial Test

* Initial functional version.
This commit is contained in:
jomjol
2022-12-27 10:20:55 +01:00
committed by GitHub
parent de223f51f6
commit 85030e39fa
12 changed files with 674 additions and 15 deletions

View File

@@ -301,6 +301,17 @@ bool RenameFile(string from, string to)
return true;
}
bool FileExists(string filename)
{
FILE* fpSourceFile = fopen(filename.c_str(), "rb");
if (!fpSourceFile) // Sourcefile existiert nicht sonst gibt es einen Fehler beim Kopierversuch!
{
return false;
}
fclose(fpSourceFile);
return true;
}
bool DeleteFile(string fn)
{
@@ -582,6 +593,17 @@ std::vector<string> ZerlegeZeile(std::string input, std::string delimiter)
}
std::string ReplaceString(std::string subject, const std::string& search,
const std::string& replace) {
size_t pos = 0;
while ((pos = subject.find(search, pos)) != std::string::npos) {
subject.replace(pos, search.length(), replace);
pos += replace.length();
}
return subject;
}
/* Source: https://git.kernel.org/pub/scm/utils/mmc/mmc-utils.git/tree/lsmmc.c */
/* SD Card Manufacturer Database */
struct SDCard_Manufacturer_database {