X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/1347f3d1e04bedd1508589173f577673ee2c5554..a3f130cbbd100c4bf662bfa0756e3d677be3632c:/include/stg/user_ips.h diff --git a/include/stg/user_ips.h b/include/stg/user_ips.h index e68190c5..e55f99fa 100644 --- a/include/stg/user_ips.h +++ b/include/stg/user_ips.h @@ -70,7 +70,8 @@ public: std::string GetIpStr() const; bool IsIPInIPS(uint32_t ip) const; bool OnlyOneIP() const; - int Count() const; + bool IsAnyIP() const; + size_t Count() const; void Add(const IP_MASK &im); void Erase(); @@ -129,9 +130,9 @@ return s.str(); } //----------------------------------------------------------------------------- inline -int USER_IPS::Count() const +size_t USER_IPS::Count() const { -return static_cast(ips.size()); +return ips.size(); } //----------------------------------------------------------------------------- inline @@ -172,6 +173,12 @@ return false; } //----------------------------------------------------------------------------- inline +bool USER_IPS::IsAnyIP() const +{ + return !ips.empty() && ips.front().ip == 0; +} +//----------------------------------------------------------------------------- +inline void USER_IPS::Add(const IP_MASK &im) { ips.push_back(im);