System zleceń - kopia
This commit is contained in:
42
user.h
Normal file
42
user.h
Normal file
@@ -0,0 +1,42 @@
|
||||
// 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
|
||||
Reference in New Issue
Block a user