mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-06 11:36:51 +03:00
Improve initial setup proc (#1692)
* Initial Test * Initial functional version.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user