- ADMIN_CONF ac;
- int h = m_admins.OpenSearch();
-
- while (m_admins.SearchNext(h, &ac) == 0)
- {
- unsigned int p = (ac.priv.userStat << 0) +
- (ac.priv.userConf << 2) +
- (ac.priv.userCash << 4) +
- (ac.priv.userPasswd << 6) +
- (ac.priv.userAddDel << 8) +
- (ac.priv.adminChg << 10) +
- (ac.priv.tariffChg << 12);
- m_answer += "<admin login=\"" + ac.login + "\" priv=\"" + x2str(p) + "\"/>";
- }
- m_admins.CloseSearch(h);
+ m_admins.fmap([this](const Admin& admin)
+ {
+ const unsigned int p = (admin.priv().userStat << 0) +
+ (admin.priv().userConf << 2) +
+ (admin.priv().userCash << 4) +
+ (admin.priv().userPasswd << 6) +
+ (admin.priv().userAddDel << 8) +
+ (admin.priv().adminChg << 10) +
+ (admin.priv().tariffChg << 12);
+ m_answer += "<admin login=\"" + admin.login() + "\" priv=\"" + std::to_string(p) + "\"/>";
+ });