X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/6e6de2ae8f5f661500c565aca8c36277e860b834..20d4dd0571e75d254444acf755a01b48a691c7c2:/stargazer/admin_impl.h diff --git a/stargazer/admin_impl.h b/stargazer/admin_impl.h deleted file mode 100644 index 34431b01..00000000 --- a/stargazer/admin_impl.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * Date: 27.10.2002 - */ - -/* - * Author : Boris Mikhailenko - */ - -#pragma once - -#include "stg/admin.h" -#include "stg/admin_conf.h" - -#include -#include - -namespace STG -{ - -class AdminImpl : public Admin { - public: - AdminImpl() noexcept : ip(0) {} - - explicit AdminImpl(const AdminConf& ac) noexcept : conf(ac), ip(0) {} - AdminImpl(const Priv& priv, - const std::string& login, - const std::string& password) noexcept - : conf(priv, login, password), ip(0) - {} - - AdminImpl(const AdminImpl&) = default; - AdminImpl& operator=(const AdminImpl&) = default; - AdminImpl(AdminImpl&&) = default; - AdminImpl& operator=(AdminImpl&&) = default; - - AdminImpl& operator=(const AdminConf& ac) noexcept { conf = ac; return *this; } - bool operator==(const AdminImpl& rhs) const noexcept { return conf.login == rhs.conf.login; } - bool operator!=(const AdminImpl& rhs) const noexcept { return !(*this == rhs); } - bool operator<(const AdminImpl& rhs) const noexcept { return conf.login < rhs.conf.login; } - //bool operator<=(const AdminImpl & rhs) const; - - const std::string& GetPassword() const override { return conf.password; } - const std::string& GetLogin() const override { return conf.login; } - const Priv* GetPriv() const override { return &conf.priv; } - uint32_t GetPrivAsInt() const override { return conf.priv.toInt(); } - const AdminConf& GetConf() const override { return conf; } - void Print() const; - uint32_t GetIP() const override { return ip; } - std::string GetIPStr() const override; - void SetIP(uint32_t v) override { ip = v; } - const std::string GetLogStr() const override; - - private: - AdminConf conf; - uint32_t ip; -}; - -}