From b08d5c2cf630ecb89d2f22b985dcdfcf25494258 Mon Sep 17 00:00:00 2001 From: Zdenek Prikryl Date: Tue, 28 Apr 2009 16:58:07 +0200 Subject: moved files to new inc directory removed commlayerinner from lybrary --- inc/ABRTException.h | 35 ++++++++++++++++++++ inc/CrashTypes.h | 71 ++++++++++++++++++++++++++++++++++++++++ lib/CommLayer/CommLayer.h | 7 ---- lib/CommLayer/CommLayerInner.cpp | 57 -------------------------------- lib/MiddleWare/CrashTypes.h | 71 ---------------------------------------- lib/Utils/ABRTException.h | 35 -------------------- 6 files changed, 106 insertions(+), 170 deletions(-) create mode 100644 inc/ABRTException.h create mode 100644 inc/CrashTypes.h delete mode 100644 lib/CommLayer/CommLayer.h delete mode 100644 lib/CommLayer/CommLayerInner.cpp delete mode 100644 lib/MiddleWare/CrashTypes.h delete mode 100644 lib/Utils/ABRTException.h diff --git a/inc/ABRTException.h b/inc/ABRTException.h new file mode 100644 index 0000000..730faf3 --- /dev/null +++ b/inc/ABRTException.h @@ -0,0 +1,35 @@ +#ifndef ABRTEXCEPTION_H_ +#define ABRTEXCEPTION_H_ + +#include + +typedef enum {EXCEP_UNKNOW, + EXCEP_DD_OPEN, + EXCEP_DD_LOAD, + EXCEP_DD_SAVE, + EXCEP_DD_DELETE, + EXCEP_DL, + EXCEP_PLUGIN, + EXCEP_ERROR, + EXCEP_FATAL} abrt_exception_t; + +class CABRTException : public std::exception +{ + private: + std::string m_sWhat; + abrt_exception_t m_Type; + public: + virtual ~CABRTException() throw() {} + CABRTException(const abrt_exception_t& pType, const char* pWhat) : + m_sWhat(pWhat), + m_Type(pType) + {} + CABRTException(const abrt_exception_t& pType, const std::string& pWhat) : + m_sWhat(pWhat), + m_Type(pType) + {} + abrt_exception_t type() { return m_Type; } + std::string what() { return m_sWhat; } +}; + +#endif /* ABRTEXCEPTION_H_ */ diff --git a/inc/CrashTypes.h b/inc/CrashTypes.h new file mode 100644 index 0000000..d53e680 --- /dev/null +++ b/inc/CrashTypes.h @@ -0,0 +1,71 @@ +#ifndef CRASHTYPES_H_ +#define CRASHTYPES_H_ + +#include +#include +#include + +// SYS - system value, should not be displayed +// BIN - binary value, should be displayed +// TXT - text value, should be displayed +// ATT - text value which can be sent as attachment via reporters +#define CD_SYS "s" +#define CD_BIN "b" +#define CD_TXT "t" +#define CD_ATT "a" + +#define CD_ATT_SIZE (256) + +#define CD_ISEDITABLE "y" +#define CD_ISNOTEDITABLE "n" + +#define CD_TYPE (0) +#define CD_EDITABLE (1) +#define CD_CONTENT (2) + +#define CD_UUID "UUID" +#define CD_UID "UID" +#define CD_COUNT "Count" +#define CD_EXECUTABLE "Executable" +#define CD_PACKAGE "Package" +#define CD_DESCRIPTION "Description" +#define CD_TIME "Time" +#define CD_REPORTED "Reported" +#define CD_COMMENT "Comment" +#define CD_REPRODUCE "How to reproduce" +#define CD_MWANALYZER "_MWAnalyzer" +#define CD_MWUID "_MWUID" +#define CD_MWUUID "_MWUUID" +#define CD_MWDDD "_MWDDD" + +// now, size of a vecor is always 3 -> +typedef std::vector vector_strings_t; +// +typedef std::map map_crash_data_t; + +typedef map_crash_data_t map_crash_info_t; +typedef std::vector vector_crash_infos_t; +typedef map_crash_data_t map_crash_report_t; + +inline void add_crash_data_to_crash_info(map_crash_info_t& pCrashInfo, + const std::string& pItem, + const std::string& pContent) +{ + pCrashInfo[pItem].push_back(CD_TXT); + pCrashInfo[pItem].push_back(CD_ISNOTEDITABLE); + pCrashInfo[pItem].push_back(pContent); +} + +inline void add_crash_data_to_crash_report(map_crash_report_t& pCrashReport, + const std::string& pItem, + const std::string& pType, + const std::string& pEditable, + const std::string& pContent) +{ + pCrashReport[pItem].push_back(pType); + pCrashReport[pItem].push_back(pEditable); + pCrashReport[pItem].push_back(pContent); +} + + +#endif /* CRASHTYPES_H_ */ diff --git a/lib/CommLayer/CommLayer.h b/lib/CommLayer/CommLayer.h deleted file mode 100644 index 044d36d..0000000 --- a/lib/CommLayer/CommLayer.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef COMMLAYER_H_ -#define COMMLAYER_H_ - -#include "CommLayerInner.h" -//extern "C" CCommLayerInner* get_commlayer(); - -#endif /* COMMLAYER_H_ */ diff --git a/lib/CommLayer/CommLayerInner.cpp b/lib/CommLayer/CommLayerInner.cpp deleted file mode 100644 index a7c5123..0000000 --- a/lib/CommLayer/CommLayerInner.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include "CommLayerInner.h" - -namespace CommLayerInner -{ - - static CDebug* g_pDebug = NULL; - static CWarning* g_pWarning = NULL; - static CStatus* g_pStatus = NULL; - - - void init_debug(CObserver* pObserver) - { - if (!g_pDebug) - { - g_pDebug = new CDebug(pObserver); - } - } - - void init_warning(CObserver* pObserver) - { - if (!g_pWarning) - { - g_pWarning = new CWarning(pObserver); - } - } - - void init_status(CObserver* pObserver) - { - if (!g_pStatus) - { - g_pStatus = new CStatus(pObserver); - } - } - - void debug(const std::string& pMessage) - { - if (g_pDebug) - { - g_pDebug->Message(pMessage); - } - } - void warning(const std::string& pMessage) - { - if (g_pWarning) - { - g_pWarning->Message(pMessage); - } - } - - void status(const std::string& pMessage) - { - if (g_pStatus) - { - g_pStatus->Message(pMessage); - } - } -} diff --git a/lib/MiddleWare/CrashTypes.h b/lib/MiddleWare/CrashTypes.h deleted file mode 100644 index d53e680..0000000 --- a/lib/MiddleWare/CrashTypes.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef CRASHTYPES_H_ -#define CRASHTYPES_H_ - -#include -#include -#include - -// SYS - system value, should not be displayed -// BIN - binary value, should be displayed -// TXT - text value, should be displayed -// ATT - text value which can be sent as attachment via reporters -#define CD_SYS "s" -#define CD_BIN "b" -#define CD_TXT "t" -#define CD_ATT "a" - -#define CD_ATT_SIZE (256) - -#define CD_ISEDITABLE "y" -#define CD_ISNOTEDITABLE "n" - -#define CD_TYPE (0) -#define CD_EDITABLE (1) -#define CD_CONTENT (2) - -#define CD_UUID "UUID" -#define CD_UID "UID" -#define CD_COUNT "Count" -#define CD_EXECUTABLE "Executable" -#define CD_PACKAGE "Package" -#define CD_DESCRIPTION "Description" -#define CD_TIME "Time" -#define CD_REPORTED "Reported" -#define CD_COMMENT "Comment" -#define CD_REPRODUCE "How to reproduce" -#define CD_MWANALYZER "_MWAnalyzer" -#define CD_MWUID "_MWUID" -#define CD_MWUUID "_MWUUID" -#define CD_MWDDD "_MWDDD" - -// now, size of a vecor is always 3 -> -typedef std::vector vector_strings_t; -// -typedef std::map map_crash_data_t; - -typedef map_crash_data_t map_crash_info_t; -typedef std::vector vector_crash_infos_t; -typedef map_crash_data_t map_crash_report_t; - -inline void add_crash_data_to_crash_info(map_crash_info_t& pCrashInfo, - const std::string& pItem, - const std::string& pContent) -{ - pCrashInfo[pItem].push_back(CD_TXT); - pCrashInfo[pItem].push_back(CD_ISNOTEDITABLE); - pCrashInfo[pItem].push_back(pContent); -} - -inline void add_crash_data_to_crash_report(map_crash_report_t& pCrashReport, - const std::string& pItem, - const std::string& pType, - const std::string& pEditable, - const std::string& pContent) -{ - pCrashReport[pItem].push_back(pType); - pCrashReport[pItem].push_back(pEditable); - pCrashReport[pItem].push_back(pContent); -} - - -#endif /* CRASHTYPES_H_ */ diff --git a/lib/Utils/ABRTException.h b/lib/Utils/ABRTException.h deleted file mode 100644 index 730faf3..0000000 --- a/lib/Utils/ABRTException.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef ABRTEXCEPTION_H_ -#define ABRTEXCEPTION_H_ - -#include - -typedef enum {EXCEP_UNKNOW, - EXCEP_DD_OPEN, - EXCEP_DD_LOAD, - EXCEP_DD_SAVE, - EXCEP_DD_DELETE, - EXCEP_DL, - EXCEP_PLUGIN, - EXCEP_ERROR, - EXCEP_FATAL} abrt_exception_t; - -class CABRTException : public std::exception -{ - private: - std::string m_sWhat; - abrt_exception_t m_Type; - public: - virtual ~CABRTException() throw() {} - CABRTException(const abrt_exception_t& pType, const char* pWhat) : - m_sWhat(pWhat), - m_Type(pType) - {} - CABRTException(const abrt_exception_t& pType, const std::string& pWhat) : - m_sWhat(pWhat), - m_Type(pType) - {} - abrt_exception_t type() { return m_Type; } - std::string what() { return m_sWhat; } -}; - -#endif /* ABRTEXCEPTION_H_ */ -- cgit