CFileHelpers: Add DebugInfo functions for displaying error messages..

..in lua script functions


Origin commit data
------------------
Branch: ni/coolstream
Commit: 83a902d524
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2016-09-04 (Sun, 04 Sep 2016)



------------------
This commit was generated by Migit
This commit is contained in:
Michael Liebmann
2016-09-04 12:00:20 +02:00
parent 06577e385c
commit 09777711fe
2 changed files with 49 additions and 0 deletions

View File

@@ -74,6 +74,13 @@ time_t toEpoch(std::string &date);
std::string& str_replace(const std::string &search, const std::string &replace, std::string &text);
std::string& htmlEntityDecode(std::string& text);
struct helpersDebugInfo {
std::string msg;
std::string file;
std::string func;
int line;
};
class CFileHelpers
{
private:
@@ -81,12 +88,22 @@ class CFileHelpers
char *FileBuf;
int fd1, fd2;
bool ConsoleQuiet;
helpersDebugInfo DebugInfo;
void setDebugInfo(const char* msg, const char* file, const char* func, int line);
void printDebugInfo();
public:
CFileHelpers();
~CFileHelpers();
static CFileHelpers* getInstance();
bool doCopyFlag;
void clearDebugInfo();
void readDebugInfo(helpersDebugInfo* di);
void setConsoleQuiet(bool q) { ConsoleQuiet = q; };
bool getConsoleQuiet() { return ConsoleQuiet; };
bool cp(const char *Src, const char *Dst, const char *Flags="");
bool copyFile(const char *Src, const char *Dst, mode_t forceMode=0);
bool copyDir(const char *Src, const char *Dst, bool backupMode=false);