43 lines
1.0 KiB
C++
43 lines
1.0 KiB
C++
// SPDX-FileCopyrightText: 2024 Krzysztof <email>
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
#ifndef USER_H
|
|
#define USER_H
|
|
#include <string>
|
|
#include <iostream>
|
|
#include <fstream>
|
|
/**
|
|
* @todo write docs
|
|
*/
|
|
class User
|
|
{
|
|
private: //wlasciwosci uzytkownikow
|
|
std::string login;
|
|
std::string password;
|
|
std::string name;
|
|
std::string surname;
|
|
int access_level;
|
|
|
|
public:
|
|
User(std::string login, std::string password, std::string name, std::string surname, int access_level);
|
|
|
|
void wyswietl() const;
|
|
|
|
// Getters
|
|
std::string GetLogin();
|
|
std::string GetName();
|
|
std::string GetSurname();
|
|
int GetAccessLevel();
|
|
//ustawienia zapisywania do pliku
|
|
void saveToFile(std::ofstream& outFile);
|
|
static User loadFromFile(std::ifstream& sourcefile);
|
|
bool authenticate(const std::string& login, const std::string& password) const; //funkcja do logowania
|
|
inline bool checkifloginexist(const std::string& login){
|
|
return this->login == login;
|
|
}
|
|
|
|
|
|
};
|
|
|
|
#endif // USER_H
|