summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2009-06-27 11:34:19 +0000
committerChris Wilson <chris+github@qwirx.com>2009-06-27 11:34:19 +0000
commit1947e0d3b89d8f4899d9fe14339ab4f54c14c830 (patch)
treebcc90dee6f2a565a929424c9dd031c03bc9e2f92 /lib
parent772b9f79c3865f02d97b926960e22d50ca56c9b8 (diff)
Make BackupStoreAccountDatabase::AddEntry and
BackupStoreAccountDatabase::GetEntry return a copy of the new entry.
Diffstat (limited to 'lib')
-rw-r--r--lib/backupstore/BackupStoreAccountDatabase.cpp7
-rw-r--r--lib/backupstore/BackupStoreAccountDatabase.h4
2 files changed, 7 insertions, 4 deletions
diff --git a/lib/backupstore/BackupStoreAccountDatabase.cpp b/lib/backupstore/BackupStoreAccountDatabase.cpp
index 46cab68f..72a813d5 100644
--- a/lib/backupstore/BackupStoreAccountDatabase.cpp
+++ b/lib/backupstore/BackupStoreAccountDatabase.cpp
@@ -289,7 +289,8 @@ bool BackupStoreAccountDatabase::EntryExists(int32_t ID) const
// Created: 2003/08/21
//
// --------------------------------------------------------------------------
-const BackupStoreAccountDatabase::Entry &BackupStoreAccountDatabase::GetEntry(int32_t ID) const
+BackupStoreAccountDatabase::Entry BackupStoreAccountDatabase::GetEntry(
+ int32_t ID) const
{
// Check that we're using the latest version of the database
CheckUpToDate();
@@ -311,12 +312,14 @@ const BackupStoreAccountDatabase::Entry &BackupStoreAccountDatabase::GetEntry(in
// Created: 2003/08/21
//
// --------------------------------------------------------------------------
-void BackupStoreAccountDatabase::AddEntry(int32_t ID, int DiscSet)
+BackupStoreAccountDatabase::Entry BackupStoreAccountDatabase::AddEntry(
+ int32_t ID, int DiscSet)
{
// Check that we're using the latest version of the database
CheckUpToDate();
pImpl->mDatabase[ID] = Entry(ID, DiscSet);
+ return pImpl->mDatabase[ID];
}
diff --git a/lib/backupstore/BackupStoreAccountDatabase.h b/lib/backupstore/BackupStoreAccountDatabase.h
index 8d6e7ad8..79573242 100644
--- a/lib/backupstore/BackupStoreAccountDatabase.h
+++ b/lib/backupstore/BackupStoreAccountDatabase.h
@@ -55,8 +55,8 @@ public:
};
bool EntryExists(int32_t ID) const;
- const Entry &GetEntry(int32_t ID) const;
- void AddEntry(int32_t ID, int DiscSet);
+ Entry GetEntry(int32_t ID) const;
+ Entry AddEntry(int32_t ID, int DiscSet);
void DeleteEntry(int32_t ID);
// This interface should change in the future. But for now it'll do.