From 6952483b39028b25d5340c8620ce10cce78e9ebd Mon Sep 17 00:00:00 2001 From: Duta-Sebastian Date: Sat, 23 Nov 2024 22:41:56 +0200 Subject: [PATCH] Removed useless methods --- .gitattributes | 1 + src/Database/Auth.cpp | 6 ------ src/Database/Auth.h | 2 -- src/Database/Database.cpp | 5 ----- src/Database/Database.h | 2 -- src/Logger/Logger.cpp | 5 ----- src/Logger/Logger.h | 2 -- src/User/User.cpp | 16 ---------------- src/User/User.h | 3 --- src/main.cpp | 8 -------- 10 files changed, 1 insertion(+), 49 deletions(-) diff --git a/.gitattributes b/.gitattributes index 0c0a3b9..adfc447 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ generated/** linguist-generated +ext/** linguist-vendored \ No newline at end of file diff --git a/src/Database/Auth.cpp b/src/Database/Auth.cpp index 1b9b1d2..85fca37 100644 --- a/src/Database/Auth.cpp +++ b/src/Database/Auth.cpp @@ -37,9 +37,3 @@ User Auth::login() const { throw; } } - -std::ostream& operator<<(std::ostream& os, const Auth& auth) { - os<< "Auth: " << auth.username << " " << auth.password<connection_string() << std::endl; - return os; -} diff --git a/src/Database/Database.h b/src/Database/Database.h index 800cbd2..17f648e 100644 --- a/src/Database/Database.h +++ b/src/Database/Database.h @@ -34,8 +34,6 @@ class Database { [[nodiscard]] int getNumberOfUsers() const; User getUserByUsername(std::string &username) const; - - friend std::ostream& operator<<(std::ostream &, const Database&); }; diff --git a/src/Logger/Logger.cpp b/src/Logger/Logger.cpp index 4bfebcc..332e80a 100644 --- a/src/Logger/Logger.cpp +++ b/src/Logger/Logger.cpp @@ -85,8 +85,3 @@ std::string Logger::generateTimestampedFilename() { << ".log"; return oss.str(); } - -std::ostream & operator<<(std::ostream & os, const Logger & logger) { - os<<"Logger has been created"<< logger.folderName<username = otherUser.username; - this->userId = otherUser.userId; -} - -User& User::operator=(const User &otherUser) { // NOLINT(*-use-equals-default) - this->username = otherUser.username; - this->userId = otherUser.userId; - this->passwordHash = otherUser.passwordHash; - return *this; -} - bool User::operator==(const User &other) const { return this->username == other.username && this->userId == other.userId && this->passwordHash == other.passwordHash; } -User::~User() { - std::cout<<"User::~User()"<username; } diff --git a/src/User/User.h b/src/User/User.h index 19ff573..c489132 100644 --- a/src/User/User.h +++ b/src/User/User.h @@ -13,10 +13,7 @@ class User { User(std::string, const std::string&); User(std::string, PasswordHash); User(int, std::string, const std::string &, std::string); - User(const User&); - User& operator=(const User&); bool operator==(const User &) const; - ~User(); friend std::ostream& operator<<(std::ostream& os, const User& user); [[nodiscard]] std::string getUsername() const; [[nodiscard]] std::string getPasswordHash() const; diff --git a/src/main.cpp b/src/main.cpp index 0dc62ca..06a9835 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -62,13 +62,5 @@ int main() { if(command == "Login") currentUser = auth.login(); else currentUser = auth.createAccount(); std::cout<<*currentUser; - const User copiedUser = *currentUser; - std::cout<