From 6cf3023c55c5fb9b78ef24300edb018438946b4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ka=C5=BAmierczak?= Date: Mon, 26 Aug 2024 17:33:43 +0200 Subject: [PATCH] adding works --- homework/password-check/main.cpp | 1 - homework/password-check/validation.cpp | 9 +++++++++ homework/password-check/validation.hpp | 9 +-------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/homework/password-check/main.cpp b/homework/password-check/main.cpp index 254ccc11..71ee124c 100644 --- a/homework/password-check/main.cpp +++ b/homework/password-check/main.cpp @@ -1,5 +1,4 @@ #include -#include #include "validation.hpp" int main() { diff --git a/homework/password-check/validation.cpp b/homework/password-check/validation.cpp index b11d6218..aeb6301a 100644 --- a/homework/password-check/validation.cpp +++ b/homework/password-check/validation.cpp @@ -3,6 +3,15 @@ #include #include // TODO: Put implementations here + +enum class ErrorCode{ + Ok, + PasswordNeedsAtLeastNineCharacters, + PasswordNeedsAtLeastOneNumber, + PasswordNeedsAtLeastOneSpecialCharacter, + PasswordNeedsAtLeastOneUppercaseLetter, + PasswordsDoNotMatch +}; bool doPasswordsMatch(std::string& pass1, std::string& pass2) { if (pass1 == pass2) { return true; diff --git a/homework/password-check/validation.hpp b/homework/password-check/validation.hpp index ead034fc..7b63aadf 100644 --- a/homework/password-check/validation.hpp +++ b/homework/password-check/validation.hpp @@ -3,14 +3,7 @@ // TODO: I'm empty :) Put enum and function headers here. // Don't forget the header guard - #pragma once -enum class ErrorCode{ - Ok, - PasswordNeedsAtLeastNineCharacters, - PasswordNeedsAtLeastOneNumber, - PasswordNeedsAtLeastOneSpecialCharacter, - PasswordNeedsAtLeastOneUppercaseLetter, - PasswordsDoNotMatch -}; +enum class ErrorCode; std::string getErrorMessage(int errorNum); bool doPasswordsMatch(std::string& pass1, std::string& pass2); int checkPasswordRules(std::string& pass);