diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-12-03 17:43:18 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-12-03 17:43:18 +0100 |
commit | a756114f9d29983d9505309efb3b6f0ed09f946f (patch) | |
tree | e86f75e53b1b910dc691d2aff11fc278821dfe7b /lib/Utils/Database.h | |
parent | 3bd822eac9229ac124fec89f7aa926cc7220972c (diff) | |
download | abrt-a756114f9d29983d9505309efb3b6f0ed09f946f.tar.gz abrt-a756114f9d29983d9505309efb3b6f0ed09f946f.tar.xz abrt-a756114f9d29983d9505309efb3b6f0ed09f946f.zip |
hopefully fix rhbz#541854: when we trim the dir, we must delete it from DB too
Also added a more robust code to resis SEGVing if directory doesn't exist.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'lib/Utils/Database.h')
-rw-r--r-- | lib/Utils/Database.h | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/lib/Utils/Database.h b/lib/Utils/Database.h index 0fc31ee7..c7a95bac 100644 --- a/lib/Utils/Database.h +++ b/lib/Utils/Database.h @@ -35,18 +35,10 @@ * primary key (UUID, UID) */ -#define DATABASE_COLUMN_UUID "UUID" -#define DATABASE_COLUMN_UID "UID" -#define DATABASE_COLUMN_DEBUG_DUMP_PATH "DebugDumpPath" -#define DATABASE_COLUMN_COUNT "Count" -#define DATABASE_COLUMN_REPORTED "Reported" -#define DATABASE_COLUMN_TIME "Time" -#define DATABASE_COLUMN_MESSAGE "Message" - /** * A struct contains one database row. */ -typedef struct SDatabaseRow +typedef struct database_row_t { std::string m_sUUID; /**< A local UUID.*/ std::string m_sUID; /**< An UID of an user.*/ @@ -83,23 +75,24 @@ class CDatabase : public CPlugin * @param pDebugDumpPath A debugdump path. * @param pTime Time when a crash occurs. */ - virtual void Insert(const std::string& pUUID, - const std::string& pUID, - const std::string& pDebugDumpPath, - const std::string& pTime) = 0; + virtual void Insert_or_Update(const char *pUUID, + const char *pUID, + const char *pDebugDumpPath, + const char *pTime) = 0; /** * A method, which deletes one row in a database. * @param pUUID A lodal UUID of a crash. * @param pUID An UID of an user. */ - virtual void Delete(const std::string& pUUID, + virtual void DeleteRow(const std::string& pUUID, const std::string& pUID) = 0; + virtual void DeleteRows_by_dir(const char *dump_dir) = 0; /** * A method, which sets that particular row was reported. * @param pUUID A local UUID of a crash. * @param pUID An UID of an user. - * @param pMessga A text explanation of reported problem (where - * it is stored etc... + * @param pMessage A text explanation of reported problem + * (where it is stored etc)... */ virtual void SetReported(const std::string& pUUID, const std::string& pUID, @@ -119,7 +112,7 @@ class CDatabase : public CPlugin * @param pUID An UID of an user. * @return A matched row. */ - virtual database_row_t GetUUIDData(const std::string& pUUID, + virtual database_row_t GetRow(const std::string& pUUID, const std::string& pUID) = 0; }; |