X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/8c6fa3fbaccc22127280bf77a48fab5a3ee0716e..46b0747592074017ff0ea4b33d4a7194235886e5:/stargazer/admin_impl.h diff --git a/stargazer/admin_impl.h b/stargazer/admin_impl.h new file mode 100644 index 00000000..cfeabf65 --- /dev/null +++ b/stargazer/admin_impl.h @@ -0,0 +1,71 @@ +/* + * 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 + */ + + /* + $Revision: 1.14 $ + $Date: 2010/10/04 20:15:43 $ + $Author: faust $ + */ + +#ifndef ADMIN_IMPL_H +#define ADMIN_IMPL_H + +#include "stg/admin.h" +#include "stg/admin_conf.h" + +#include +#include + +class ADMIN_IMPL : public ADMIN { +public: + ADMIN_IMPL(); + explicit ADMIN_IMPL(const ADMIN_CONF & ac); + ADMIN_IMPL(const PRIV & priv, + const std::string & login, + const std::string & password); + virtual ~ADMIN_IMPL() {} + + ADMIN_IMPL & operator=(const ADMIN_CONF &); + bool operator==(const ADMIN_IMPL & rhs) const; + bool operator!=(const ADMIN_IMPL & rhs) const; + bool operator<(const ADMIN_IMPL & rhs) const; + bool operator<=(const ADMIN_IMPL & rhs) const; + + const std::string & GetPassword() const { return conf.password; } + const std::string & GetLogin() const { return conf.login; } + PRIV const * GetPriv() const { return &conf.priv; } + uint32_t GetPrivAsInt() const { return conf.priv.ToInt(); } + const ADMIN_CONF & GetConf() const { return conf; } + void Print() const; + uint32_t GetIP() const { return ip; } + std::string GetIPStr() const; + void SetIP(uint32_t v) { ip = v; } + const std::string GetLogStr() const; + +private: + ADMIN_CONF conf; + uint32_t ip; +}; + +#endif