From d302872fa0e5ed605d07a46414407e70f3253a58 Mon Sep 17 00:00:00 2001 From: Zdenek Prikryl Date: Wed, 4 Mar 2009 11:25:34 +0100 Subject: rename files according new project name --- lib/MiddleWare/ABRTPlugin.cpp | 91 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 lib/MiddleWare/ABRTPlugin.cpp (limited to 'lib/MiddleWare/ABRTPlugin.cpp') diff --git a/lib/MiddleWare/ABRTPlugin.cpp b/lib/MiddleWare/ABRTPlugin.cpp new file mode 100644 index 0000000..04ff3a8 --- /dev/null +++ b/lib/MiddleWare/ABRTPlugin.cpp @@ -0,0 +1,91 @@ +/* + CrashCatcherPlugin.cpp + + Copyright (C) 2009 Zdenek Prikryl (zprikryl@redhat.com) + Copyright (C) 2009 RedHat inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "CrashCatcherPlugin.h" + +CCrashCatcherPlugin::CCrashCatcherPlugin(const std::string& pLibPath) : + m_pDynamicLibrary(NULL), + m_pPluginInfo(NULL), + m_pFnPluginNew(NULL) +{ + try + { + m_pDynamicLibrary = new CDynamicLibrary(pLibPath); + if (m_pDynamicLibrary == NULL) + { + throw std::string("Not enought memory."); + } + m_pPluginInfo = (p_plugin_info_t) m_pDynamicLibrary->FindSymbol("plugin_info"); + m_pFnPluginNew = (p_fn_plugin_new_t) m_pDynamicLibrary->FindSymbol("plugin_new"); + } + catch (...) + { + throw; + } +} + +CCrashCatcherPlugin::~CCrashCatcherPlugin() +{ + if (m_pDynamicLibrary != NULL) + { + delete m_pDynamicLibrary; + } +} + +const std::string& CCrashCatcherPlugin::GetVersion() +{ + return m_pPluginInfo->m_sVersion; +} + +const int CCrashCatcherPlugin::GetMagicNumber() +{ + return m_pPluginInfo->m_nMagicNumber; +} + +const std::string& CCrashCatcherPlugin::GetName() +{ + return m_pPluginInfo->m_sName; +} + +const std::string& CCrashCatcherPlugin::GetDescription() +{ + return m_pPluginInfo->m_sDescription; +} + +const std::string& CCrashCatcherPlugin::GetEmail() +{ + return m_pPluginInfo->m_sEmail; +} + +const std::string& CCrashCatcherPlugin::GetWWW() +{ + return m_pPluginInfo->m_sWWW; +} + +const plugin_type_t CCrashCatcherPlugin::GetType() +{ + return m_pPluginInfo->m_Type; +} + +CPlugin* CCrashCatcherPlugin::PluginNew() +{ + return m_pFnPluginNew(); +} -- cgit From 8e0b0f53b0cc139c45619472177ddbf8e616a947 Mon Sep 17 00:00:00 2001 From: Zdenek Prikryl Date: Wed, 4 Mar 2009 11:26:36 +0100 Subject: replace old project name by new one --- lib/MiddleWare/ABRTPlugin.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'lib/MiddleWare/ABRTPlugin.cpp') diff --git a/lib/MiddleWare/ABRTPlugin.cpp b/lib/MiddleWare/ABRTPlugin.cpp index 04ff3a8..788d5c9 100644 --- a/lib/MiddleWare/ABRTPlugin.cpp +++ b/lib/MiddleWare/ABRTPlugin.cpp @@ -1,5 +1,5 @@ /* - CrashCatcherPlugin.cpp + ABRTPlugin.cpp Copyright (C) 2009 Zdenek Prikryl (zprikryl@redhat.com) Copyright (C) 2009 RedHat inc. @@ -19,9 +19,9 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "CrashCatcherPlugin.h" +#include "ABRTPlugin.h" -CCrashCatcherPlugin::CCrashCatcherPlugin(const std::string& pLibPath) : +CABRTPlugin::CABRTPlugin(const std::string& pLibPath) : m_pDynamicLibrary(NULL), m_pPluginInfo(NULL), m_pFnPluginNew(NULL) @@ -42,7 +42,7 @@ CCrashCatcherPlugin::CCrashCatcherPlugin(const std::string& pLibPath) : } } -CCrashCatcherPlugin::~CCrashCatcherPlugin() +CABRTPlugin::~CABRTPlugin() { if (m_pDynamicLibrary != NULL) { @@ -50,42 +50,42 @@ CCrashCatcherPlugin::~CCrashCatcherPlugin() } } -const std::string& CCrashCatcherPlugin::GetVersion() +const std::string& CABRTPlugin::GetVersion() { return m_pPluginInfo->m_sVersion; } -const int CCrashCatcherPlugin::GetMagicNumber() +const int CABRTPlugin::GetMagicNumber() { return m_pPluginInfo->m_nMagicNumber; } -const std::string& CCrashCatcherPlugin::GetName() +const std::string& CABRTPlugin::GetName() { return m_pPluginInfo->m_sName; } -const std::string& CCrashCatcherPlugin::GetDescription() +const std::string& CABRTPlugin::GetDescription() { return m_pPluginInfo->m_sDescription; } -const std::string& CCrashCatcherPlugin::GetEmail() +const std::string& CABRTPlugin::GetEmail() { return m_pPluginInfo->m_sEmail; } -const std::string& CCrashCatcherPlugin::GetWWW() +const std::string& CABRTPlugin::GetWWW() { return m_pPluginInfo->m_sWWW; } -const plugin_type_t CCrashCatcherPlugin::GetType() +const plugin_type_t CABRTPlugin::GetType() { return m_pPluginInfo->m_Type; } -CPlugin* CCrashCatcherPlugin::PluginNew() +CPlugin* CABRTPlugin::PluginNew() { return m_pFnPluginNew(); } -- cgit