From 2aae786d9a928382edb5c2115282cb6f8ac27515 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 8 Jul 2017 12:17:21 +0100 Subject: [PATCH] Rename BackupStoreAccountsControl to BackupStoreAccountControl For consistency with the base class, BackupAccountControl, and grammatical reasons. --- bin/bbstoreaccounts/bbstoreaccounts.cpp | 3 ++- lib/backupstore/BackupAccountControl.cpp | 20 ++++++++++---------- lib/backupstore/BackupAccountControl.h | 5 +++-- lib/backupstore/StoreTestUtils.cpp | 11 ++++++----- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/bin/bbstoreaccounts/bbstoreaccounts.cpp b/bin/bbstoreaccounts/bbstoreaccounts.cpp index 2de4935d8..236bd569d 100644 --- a/bin/bbstoreaccounts/bbstoreaccounts.cpp +++ b/bin/bbstoreaccounts/bbstoreaccounts.cpp @@ -21,6 +21,7 @@ #include #include "box_getopt.h" +#include "BackupAccountControl.h" #include "BackupStoreAccounts.h" #include "BackupStoreAccountDatabase.h" #include "BackupStoreCheck.h" @@ -175,7 +176,7 @@ int main(int argc, const char *argv[]) argc--; - BackupStoreAccountsControl control(*config, machineReadableOutput); + BackupStoreAccountControl control(*config, machineReadableOutput); // Now do the command. if(command == "create") diff --git a/lib/backupstore/BackupAccountControl.cpp b/lib/backupstore/BackupAccountControl.cpp index e6a3a2dfe..b87fe1218 100644 --- a/lib/backupstore/BackupAccountControl.cpp +++ b/lib/backupstore/BackupAccountControl.cpp @@ -144,7 +144,7 @@ int BackupAccountControl::PrintAccountInfo(const BackupStoreInfo& info, return 0; } -int BackupStoreAccountsControl::BlockSizeOfDiscSet(int discSetNum) +int BackupStoreAccountControl::BlockSizeOfDiscSet(int discSetNum) { // Get controller, check disc set number RaidFileController &controller(RaidFileController::GetController()); @@ -158,7 +158,7 @@ int BackupStoreAccountsControl::BlockSizeOfDiscSet(int discSetNum) return controller.GetDiscSet(discSetNum).GetBlockSize(); } -int BackupStoreAccountsControl::SetLimit(int32_t ID, const char *SoftLimitStr, +int BackupStoreAccountControl::SetLimit(int32_t ID, const char *SoftLimitStr, const char *HardLimitStr) { std::string rootDir; @@ -194,7 +194,7 @@ int BackupStoreAccountsControl::SetLimit(int32_t ID, const char *SoftLimitStr, return 0; } -int BackupStoreAccountsControl::SetAccountName(int32_t ID, const std::string& rNewAccountName) +int BackupStoreAccountControl::SetAccountName(int32_t ID, const std::string& rNewAccountName) { std::string rootDir; int discSetNum; @@ -223,7 +223,7 @@ int BackupStoreAccountsControl::SetAccountName(int32_t ID, const std::string& rN return 0; } -int BackupStoreAccountsControl::PrintAccountInfo(int32_t ID) +int BackupStoreAccountControl::PrintAccountInfo(int32_t ID) { std::string rootDir; int discSetNum; @@ -245,7 +245,7 @@ int BackupStoreAccountsControl::PrintAccountInfo(int32_t ID) BlockSizeOfDiscSet(discSetNum)); } -int BackupStoreAccountsControl::SetAccountEnabled(int32_t ID, bool enabled) +int BackupStoreAccountControl::SetAccountEnabled(int32_t ID, bool enabled) { std::string rootDir; int discSetNum; @@ -267,7 +267,7 @@ int BackupStoreAccountsControl::SetAccountEnabled(int32_t ID, bool enabled) return 0; } -int BackupStoreAccountsControl::DeleteAccount(int32_t ID, bool AskForConfirmation) +int BackupStoreAccountControl::DeleteAccount(int32_t ID, bool AskForConfirmation) { std::string rootDir; int discSetNum; @@ -383,7 +383,7 @@ int BackupStoreAccountsControl::DeleteAccount(int32_t ID, bool AskForConfirmatio return retcode; } -bool BackupStoreAccountsControl::OpenAccount(int32_t ID, std::string &rRootDirOut, +bool BackupStoreAccountControl::OpenAccount(int32_t ID, std::string &rRootDirOut, int &rDiscSetOut, std::auto_ptr apUser, NamedLock* pLock) { // Load in the account database @@ -431,7 +431,7 @@ bool BackupStoreAccountsControl::OpenAccount(int32_t ID, std::string &rRootDirOu return true; } -int BackupStoreAccountsControl::CheckAccount(int32_t ID, bool FixErrors, bool Quiet, +int BackupStoreAccountControl::CheckAccount(int32_t ID, bool FixErrors, bool Quiet, bool ReturnNumErrorsFound) { std::string rootDir; @@ -461,7 +461,7 @@ int BackupStoreAccountsControl::CheckAccount(int32_t ID, bool FixErrors, bool Qu } } -int BackupStoreAccountsControl::CreateAccount(int32_t ID, int32_t DiscNumber, +int BackupStoreAccountControl::CreateAccount(int32_t ID, int32_t DiscNumber, int32_t SoftLimit, int32_t HardLimit) { // Load in the account database @@ -496,7 +496,7 @@ int BackupStoreAccountsControl::CreateAccount(int32_t ID, int32_t DiscNumber, return 0; } -int BackupStoreAccountsControl::HousekeepAccountNow(int32_t ID) +int BackupStoreAccountControl::HousekeepAccountNow(int32_t ID) { std::string rootDir; int discSetNum; diff --git a/lib/backupstore/BackupAccountControl.h b/lib/backupstore/BackupAccountControl.h index f0eda3a86..4e2f48dba 100644 --- a/lib/backupstore/BackupAccountControl.h +++ b/lib/backupstore/BackupAccountControl.h @@ -41,10 +41,11 @@ class BackupAccountControl int PrintAccountInfo(const BackupStoreInfo& info, int BlockSize); }; -class BackupStoreAccountsControl : public BackupAccountControl + +class BackupStoreAccountControl : public BackupAccountControl { public: - BackupStoreAccountsControl(const Configuration& config, + BackupStoreAccountControl(const Configuration& config, bool machineReadableOutput = false) : BackupAccountControl(config, machineReadableOutput) { } diff --git a/lib/backupstore/StoreTestUtils.cpp b/lib/backupstore/StoreTestUtils.cpp index cf990598c..c30350d57 100644 --- a/lib/backupstore/StoreTestUtils.cpp +++ b/lib/backupstore/StoreTestUtils.cpp @@ -13,12 +13,13 @@ #include #include "autogen_BackupProtocol.h" -#include "BoxPortsAndFiles.h" +#include "BackupAccountControl.h" #include "BackupStoreAccounts.h" #include "BackupStoreAccountDatabase.h" #include "BackupStoreConfigVerify.h" #include "BackupStoreConstants.h" #include "BackupStoreInfo.h" +#include "BoxPortsAndFiles.h" #include "HousekeepStoreAccount.h" #include "Logging.h" #include "ServerControl.h" @@ -33,7 +34,7 @@ bool create_account(int soft, int hard) std::auto_ptr config( Configuration::LoadAndVerify ("testfiles/bbstored.conf", &BackupConfigFileVerify, errs)); - BackupStoreAccountsControl control(*config); + BackupStoreAccountControl control(*config); Logger::LevelGuard guard(Logging::GetConsole(), Log::WARNING); int result = control.CreateAccount(0x01234567, 0, soft, hard); @@ -47,7 +48,7 @@ bool delete_account() std::auto_ptr config( Configuration::LoadAndVerify ("testfiles/bbstored.conf", &BackupConfigFileVerify, errs)); - BackupStoreAccountsControl control(*config); + BackupStoreAccountControl control(*config); Logger::LevelGuard guard(Logging::GetConsole(), Log::WARNING); TEST_THAT_THROWONFAIL(control.DeleteAccount(0x01234567, false) == 0); return true; @@ -168,7 +169,7 @@ bool change_account_limits(const char* soft, const char* hard) std::auto_ptr config( Configuration::LoadAndVerify ("testfiles/bbstored.conf", &BackupConfigFileVerify, errs)); - BackupStoreAccountsControl control(*config); + BackupStoreAccountControl control(*config); int result = control.SetLimit(0x01234567, soft, hard); TEST_EQUAL(0, result); return (result == 0); @@ -183,7 +184,7 @@ int check_account_for_errors(Log::Level log_level) std::auto_ptr config( Configuration::LoadAndVerify("testfiles/bbstored.conf", &BackupConfigFileVerify, errs)); - BackupStoreAccountsControl control(*config); + BackupStoreAccountControl control(*config); int errors_fixed = control.CheckAccount(0x01234567, true, // FixErrors false, // Quiet