summaryrefslogtreecommitdiffstats
path: root/lib/Utils/DebugDump.cpp
diff options
context:
space:
mode:
authorZdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com>2009-05-13 09:07:13 +0200
committerZdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com>2009-05-13 09:07:13 +0200
commitaf4c77fba221dfa43363d2f9b5d8f73bc3ff473b (patch)
treeca53dd6f4b836126bba3824de6955fd3d5580d97 /lib/Utils/DebugDump.cpp
parent6b77cb82cb7b918660435effb0fe356401bfdd55 (diff)
downloadabrt-af4c77fba221dfa43363d2f9b5d8f73bc3ff473b.tar.gz
abrt-af4c77fba221dfa43363d2f9b5d8f73bc3ff473b.tar.xz
abrt-af4c77fba221dfa43363d2f9b5d8f73bc3ff473b.zip
added checks for debugdump status
Diffstat (limited to 'lib/Utils/DebugDump.cpp')
-rw-r--r--lib/Utils/DebugDump.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/Utils/DebugDump.cpp b/lib/Utils/DebugDump.cpp
index f4d4cc9..1b7fbd1 100644
--- a/lib/Utils/DebugDump.cpp
+++ b/lib/Utils/DebugDump.cpp
@@ -399,28 +399,48 @@ void CDebugDump::SaveBinaryFile(const std::string& pPath, const char* pData, con
void CDebugDump::LoadText(const std::string& pName, std::string& pData)
{
+ if (!m_bOpened)
+ {
+ throw CABRTException(EXCEP_DD_OPEN, "CDebugDump::LoadText(): DebugDump is not opened.");
+ }
std::string fullPath = m_sDebugDumpDir + "/" + pName;
LoadTextFile(fullPath, pData);
}
void CDebugDump::LoadBinary(const std::string& pName, char** pData, unsigned int* pSize)
{
+ if (!m_bOpened)
+ {
+ throw CABRTException(EXCEP_DD_OPEN, "CDebugDump::LoadBinary(): DebugDump is not opened.");
+ }
std::string fullPath = m_sDebugDumpDir + "/" + pName;
LoadBinaryFile(fullPath, pData, pSize);
}
void CDebugDump::SaveText(const std::string& pName, const std::string& pData)
{
+ if (!m_bOpened)
+ {
+ throw CABRTException(EXCEP_DD_OPEN, "CDebugDump::SaveText(): DebugDump is not opened.");
+ }
std::string fullPath = m_sDebugDumpDir + "/" + pName;
SaveTextFile(fullPath, pData);
}
void CDebugDump::SaveBinary(const std::string& pName, const char* pData, const unsigned int pSize)
{
+ if (!m_bOpened)
+ {
+ throw CABRTException(EXCEP_DD_OPEN, "CDebugDump::SaveBinary(): DebugDump is not opened.");
+ }
std::string fullPath = m_sDebugDumpDir + "/" + pName;
SaveBinaryFile(fullPath, pData, pSize);
}
void CDebugDump::InitGetNextFile()
{
+ if (!m_bOpened)
+ {
+ throw CABRTException(EXCEP_DD_OPEN, "CDebugDump::InitGetNextFile(): DebugDump is not opened.");
+ }
if (m_pGetNextFileDir != NULL)
{
closedir(m_pGetNextFileDir);