qswiki/database/userdao.h

21 lines
504 B
C
Raw Permalink Normal View History

2018-11-03 17:12:20 +01:00
#ifndef USERDAO_H
#define USERDAO_H
#include <string>
#include <optional>
#include "../user.h"
2021-09-26 15:05:15 +02:00
#include "queryoption.h"
2018-11-03 17:12:20 +01:00
class UserDao
{
public:
UserDao();
virtual bool exists(std::string username) = 0;
virtual std::optional<User> find(std::string username) = 0;
virtual std::optional<User> find(int id) = 0;
2021-09-26 15:05:15 +02:00
virtual std::vector<User> list(QueryOption o) = 0;
2018-11-03 17:12:20 +01:00
virtual void deleteUser(std::string username) = 0;
virtual void save(const User &u) = 0;
virtual ~UserDao(){};
};
#endif // USERDAO_H