2023-01-02 13:17:18 -06:00
|
|
|
#ifndef UTIL_C_STATUS_HPP
|
|
|
|
|
#define UTIL_C_STATUS_HPP
|
|
|
|
|
|
2024-03-06 00:53:07 +04:00
|
|
|
#include <storm/List.hpp>
|
|
|
|
|
#include <storm/Log.hpp>
|
|
|
|
|
|
2023-01-02 13:17:18 -06:00
|
|
|
enum STATUS_TYPE {
|
|
|
|
|
STATUS_INFO = 0x0,
|
|
|
|
|
STATUS_WARNING = 0x1,
|
|
|
|
|
STATUS_ERROR = 0x2,
|
|
|
|
|
STATUS_FATAL = 0x3,
|
|
|
|
|
STATUS_NUMTYPES = 0x4,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class CStatus {
|
2024-03-06 00:53:07 +04:00
|
|
|
public:
|
|
|
|
|
struct STATUSENTRY {
|
|
|
|
|
char* text;
|
|
|
|
|
STATUS_TYPE severity;
|
|
|
|
|
TSLink<CStatus::STATUSENTRY> link;
|
|
|
|
|
};
|
|
|
|
|
|
2023-01-02 13:17:18 -06:00
|
|
|
public:
|
|
|
|
|
// Static variables
|
|
|
|
|
static CStatus s_errorList;
|
|
|
|
|
|
|
|
|
|
// Member functions
|
|
|
|
|
void Add(const CStatus&);
|
|
|
|
|
void Add(STATUS_TYPE, const char*, ...);
|
2024-03-06 00:53:07 +04:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
STORM_EXPLICIT_LIST(CStatus::STATUSENTRY, link) statusList;
|
2023-01-02 13:17:18 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class CWOWClientStatus : public CStatus {
|
|
|
|
|
public:
|
2024-03-06 00:53:07 +04:00
|
|
|
HSLOG m_logFile = nullptr;
|
2023-01-02 13:17:18 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
CStatus& GetGlobalStatusObj(void);
|
|
|
|
|
|
|
|
|
|
#endif
|