]> git.stg.codes - stg.git/blob - tests/testusers.h
Public interfaces: part 1
[stg.git] / tests / testusers.h
1 #ifndef __TEST_USERS_H__
2 #define __TEST_USERS_H__
3
4 #include "stg/users.h"
5
6 class TEST_USERS : public STG::Users {
7     public:
8         TEST_USERS() {}
9
10         using UserPtr = STG::User*;
11         using ConstUserPtr = const STG::User*;
12
13         int  FindByName(const std::string & /*login*/, UserPtr * /*user*/) override
14         { return -1; }
15         int  FindByName(const std::string & /*login*/, ConstUserPtr * /*user*/) const override
16         { return -1; }
17
18         bool TariffInUse(const std::string & /*tariffName*/) const override
19         { return -1; }
20
21         void AddNotifierUserAdd(STG::NotifierBase<UserPtr> * /*notifier*/) override {}
22         void DelNotifierUserAdd(STG::NotifierBase<UserPtr> * /*notifier*/) override {}
23
24         void AddNotifierUserDel(STG::NotifierBase<UserPtr> * /*notifier*/) override {}
25         void DelNotifierUserDel(STG::NotifierBase<UserPtr> * /*notifier*/) override {}
26
27         int  Add(const std::string & /*login*/, const STG::Admin * /*admin*/) override
28         { return 0; }
29         void Del(const std::string & /*login*/, const STG::Admin * /*admin*/) override {}
30
31         bool Authorize(const std::string &, uint32_t, uint32_t, const STG::Auth *) override
32         { return false; }
33         bool Unauthorize(const std::string &, const STG::Auth *, const std::string &) override
34         { return false; }
35
36         int  ReadUsers() override { return 0; }
37         virtual size_t Count() const override { return 0; };
38
39         int  FindByIPIdx(uint32_t /*ip*/, UserPtr * /*user*/) const override
40         { return -1; }
41         bool IsIPInIndex(uint32_t /*ip*/) const override { return false; }
42         bool IsIPInUse(uint32_t, const std::string &, ConstUserPtr *) const override { return false; }
43         bool Exists(const std::string &) const override { return false; }
44
45         int  OpenSearch() override { return 0; }
46         int  SearchNext(int /*handle*/, UserPtr * /*u*/) override { return -1; }
47         int  CloseSearch(int /*handle*/) override { return 0; }
48
49         int  Start() override { return 0; }
50         int  Stop() override { return 0; }
51
52     private:
53 };
54
55 #endif