diff options
Diffstat (limited to 'bin/bbackupd')
-rw-r--r-- | bin/bbackupd/BackupDaemon.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bin/bbackupd/BackupDaemon.h b/bin/bbackupd/BackupDaemon.h index a6cb8d46..ba46dec2 100644 --- a/bin/bbackupd/BackupDaemon.h +++ b/bin/bbackupd/BackupDaemon.h @@ -109,6 +109,25 @@ public: }; int GetState() {return mState;} + static std::string GetStateName(int state) + { + std::string stateName; + + #define STATE(x) case BackupDaemon::State_ ## x: stateName = #x; break; + switch (state) + { + STATE(Initialising); + STATE(Idle); + STATE(Connected); + STATE(Error); + STATE(StorageLimitExceeded); + default: + stateName = "unknown"; + } + #undef STATE + + return stateName; + } // Allow other classes to call this too void NotifySysadmin(SysadminNotifier::EventCode Event); |