mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
- helpers: add function to get backup suffix
Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -53,6 +53,7 @@
|
|||||||
//#include <driver/framebuffer.h>
|
//#include <driver/framebuffer.h>
|
||||||
#include <system/helpers.h>
|
#include <system/helpers.h>
|
||||||
#include <system/helpers-json.h>
|
#include <system/helpers-json.h>
|
||||||
|
#include <lib/libnet/libnet.h>
|
||||||
#include <gui/update_ext.h>
|
#include <gui/update_ext.h>
|
||||||
#include <libmd5sum.h>
|
#include <libmd5sum.h>
|
||||||
#define MD5_DIGEST_LENGTH 16
|
#define MD5_DIGEST_LENGTH 16
|
||||||
@@ -493,6 +494,13 @@ std::string getFileExt(std::string &file)
|
|||||||
return _getBaseName(f, ".");
|
return _getBaseName(f, ".");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string getBackupSuffix()
|
||||||
|
{
|
||||||
|
std::string hostName = "";
|
||||||
|
netGetHostname(hostName);
|
||||||
|
|
||||||
|
return hostName + getNowTimeStr("_%Y%m%d_%H%M");
|
||||||
|
}
|
||||||
|
|
||||||
std::string getNowTimeStr(const char* format)
|
std::string getNowTimeStr(const char* format)
|
||||||
{
|
{
|
||||||
|
@@ -69,6 +69,7 @@ std::string getPathName(std::string &path);
|
|||||||
std::string getBaseName(std::string &path);
|
std::string getBaseName(std::string &path);
|
||||||
std::string getFileName(std::string &file);
|
std::string getFileName(std::string &file);
|
||||||
std::string getFileExt(std::string &file);
|
std::string getFileExt(std::string &file);
|
||||||
|
std::string getBackupSuffix();
|
||||||
std::string getNowTimeStr(const char* format);
|
std::string getNowTimeStr(const char* format);
|
||||||
std::string trim(std::string& str, const std::string& trimChars = " \n\r\t");
|
std::string trim(std::string& str, const std::string& trimChars = " \n\r\t");
|
||||||
std::string ltrim(std::string& str, const std::string& trimChars = " \n\r\t");
|
std::string ltrim(std::string& str, const std::string& trimChars = " \n\r\t");
|
||||||
|
Reference in New Issue
Block a user