diff options
| author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-05-13 16:05:50 +0200 |
|---|---|---|
| committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-05-13 16:05:50 +0200 |
| commit | 407222babd840bcc935789dc441f6099f9d22412 (patch) | |
| tree | 443d21c220cd985877635cd5e1fa9aa171b40f6b /lib/Utils/DebugDump.cpp | |
| parent | b6bc6d13eed2f346414d731ecb29579a719556f3 (diff) | |
| parent | 146b08ec6920405b608d7ec75c6ac49727cd4b68 (diff) | |
| download | abrt-407222babd840bcc935789dc441f6099f9d22412.tar.gz abrt-407222babd840bcc935789dc441f6099f9d22412.tar.xz abrt-407222babd840bcc935789dc441f6099f9d22412.zip | |
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
Diffstat (limited to 'lib/Utils/DebugDump.cpp')
| -rw-r--r-- | lib/Utils/DebugDump.cpp | 20 |
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); |
