-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathValidationData.hpp
More file actions
50 lines (42 loc) · 1.69 KB
/
ValidationData.hpp
File metadata and controls
50 lines (42 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#pragma once
#include <stdlib.h> // for size_t
#include <string>
namespace {
constexpr char CURRENTLY_DATE[] = "13082021"; // FORMAT DATE DDMMYYYY
constexpr uint8_t NAMESIZE { 15 };
constexpr uint8_t SURNAMESIZE { 20 };
constexpr uint8_t ADDRESSSIZE { 35 };
constexpr uint8_t GENDERSIZE { 6 };
constexpr uint8_t PESELNUMBERSIZE { 11 };
constexpr uint8_t INDEXNUMBERSIZE { 10 };
constexpr uint8_t SALARYSIZE { 5 };
}
class ValidationData {
public:
enum class YesNoConfirm{
NoConfirm,
Yes,
No,
Error,
Back
};
bool isCorrectMenuChoice(const size_t choosenValueToValid, const size_t sizeMenu);
bool validationIsAlpabet(std::string stringToCheck);
bool validationIsDigit(std::string stringToCheck);
bool validationStringSize(std::string userStringData, uint8_t maxSize, bool isEqual = false);
bool peselValidDOBCheck(std::string dayOfBirth);
bool peselValidGenderCheck(char charGender, std::string peselNumber);
bool peselValidWithCurrentlyDate(std::string peselNumber);
bool peselValidWithWeight(std::string peseNumber);
bool validatingPeselNumber(std::string peselNumber);
bool validatingGender(char userChoice);
YesNoConfirm confirmDataYesNo(std::string question);
uint8_t getNameSize() const { return NAMESIZE; }
uint8_t getSurnameSize() const { return SURNAMESIZE; }
uint8_t getAddressSize() const { return ADDRESSSIZE; }
uint8_t getGenderSize() const { return GENDERSIZE; }
uint8_t getPeselNumberSize() const { return PESELNUMBERSIZE; }
uint8_t getIndexNumberSize() const { return INDEXNUMBERSIZE; }
uint8_t getSalarySize() const { return SALARYSIZE; }
private:
};