4 #include "stg/optional.h"
14 //-----------------------------------------------------------------------------
20 disabledDetailStat(0),
23 userdata(USERDATA_NUM),
27 UserConf(const UserConf&) = default;
28 UserConf& operator=(const UserConf&) = default;
29 UserConf(UserConf&&) = default;
30 UserConf& operator=(UserConf&&) = default;
35 int disabledDetailStat;
37 std::string tariffName;
44 std::vector<std::string> services;
47 std::string nextTariff;
48 std::vector<std::string> userdata;
52 //-----------------------------------------------------------------------------
55 UserConfOpt() noexcept
56 : userdata(USERDATA_NUM)
58 UserConfOpt(const UserConf& data) noexcept
59 : password(data.password),
60 passive(data.passive),
61 disabled(data.disabled),
62 disabledDetailStat(data.disabledDetailStat),
63 alwaysOnline(data.alwaysOnline),
64 tariffName(data.tariffName),
65 address(data.address),
69 realName(data.realName),
73 nextTariff(data.nextTariff),
74 userdata(USERDATA_NUM),
75 services(data.services),
76 creditExpire(data.creditExpire),
79 for (size_t i = 0; i < USERDATA_NUM; i++)
80 userdata[i] = data.userdata[i];
82 UserConfOpt& operator=(const UserConf& uc) noexcept
84 userdata.resize(USERDATA_NUM);
85 password = uc.password;
87 disabled = uc.disabled;
88 disabledDetailStat = uc.disabledDetailStat;
89 alwaysOnline = uc.alwaysOnline;
90 tariffName = uc.tariffName;
95 realName = uc.realName;
99 nextTariff = uc.nextTariff;
100 for (size_t i = 0; i < USERDATA_NUM; i++) userdata[i] = uc.userdata[i];
101 services = uc.services;
102 creditExpire = uc.creditExpire;
106 //-------------------------------------------------------------------------
108 UserConfOpt(const UserConfOpt&) = default;
109 UserConfOpt& operator=(const UserConfOpt&) = default;
110 UserConfOpt(UserConfOpt&&) = default;
111 UserConfOpt& operator=(UserConfOpt&&) = default;
113 Optional<std::string> password;
114 Optional<int> passive;
115 Optional<int> disabled;
116 Optional<int> disabledDetailStat;
117 Optional<int> alwaysOnline;
118 Optional<std::string> tariffName;
119 Optional<std::string> address;
120 Optional<std::string> phone;
121 Optional<std::string> email;
122 Optional<std::string> note;
123 Optional<std::string> realName;
124 Optional<std::string> corp;
125 Optional<std::string> group;
126 Optional<double> credit;
127 Optional<std::string> nextTariff;
128 std::vector<Optional<std::string> > userdata;
129 Optional<std::vector<std::string> > services;
130 Optional<time_t> creditExpire;
131 Optional<UserIPs> ips;
133 //-----------------------------------------------------------------------------