3 #include "stg/optional.h"
9 #define ADM_LOGIN_LEN (32)
10 #define ADM_PASSWD_LEN (32)
17 Priv() noexcept : Priv(0) {}
18 explicit Priv(uint32_t p) noexcept
19 : userStat((p & 0x00000003) >> 0x00),
20 userConf((p & 0x0000000C) >> 0x02),
21 userCash((p & 0x00000030) >> 0x04),
22 userPasswd((p & 0x000000C0) >> 0x06),
23 userAddDel((p & 0x00000300) >> 0x08),
24 adminChg((p & 0x00000C00) >> 0x0A),
25 tariffChg((p & 0x00003000) >> 0x0C),
26 serviceChg((p & 0x0000C000) >> 0x0E),
27 corpChg((p & 0x00030000) >> 0x10)
30 Priv(const Priv&) = default;
31 Priv& operator=(const Priv&) = default;
32 Priv(Priv&&) = default;
33 Priv& operator=(Priv&&) = default;
35 uint32_t toInt() const noexcept
37 uint32_t p = (userStat << 0) |
59 //-----------------------------------------------------------------------------
62 AdminConf() : AdminConf({}, {}, "* NO PASSWORD *") {}
63 AdminConf(const Priv& pr, const std::string& l, const std::string& p)
69 AdminConf(const AdminConf&) = default;
70 AdminConf& operator=(const AdminConf&) = default;
71 AdminConf(AdminConf&&) = default;
72 AdminConf& operator=(AdminConf&&) = default;
78 //-----------------------------------------------------------------------------
82 Optional<std::string> login;
83 Optional<std::string> password;