git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Ticket 37. The time_t currentTime parameter added in
[stg.git]
/
include
/
stg
/
user_ips.h
diff --git
a/include/stg/user_ips.h
b/include/stg/user_ips.h
index e68190c543e5531227ad13c444be1c4b9c728327..52e5df77d7dba6e9e702ab634caef19cd3f49325 100644
(file)
--- 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;
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();
void Add(const IP_MASK &im);
void Erase();
@@
-129,9
+130,9
@@
return s.str();
}
//-----------------------------------------------------------------------------
inline
}
//-----------------------------------------------------------------------------
inline
-
in
t USER_IPS::Count() const
+
size_
t USER_IPS::Count() const
{
{
-return
static_cast<int>(ips.size()
);
+return
ips.size(
);
}
//-----------------------------------------------------------------------------
inline
}
//-----------------------------------------------------------------------------
inline
@@
-165,13
+166,19
@@
return false;
inline
bool USER_IPS::OnlyOneIP() const
{
inline
bool USER_IPS::OnlyOneIP() const
{
-if (ips.size() == 1 && ips.front().mask == 32)
+if (ips.size() == 1 && ips.front().mask == 32
&& ips.front().ip != 0
)
return true;
return false;
}
//-----------------------------------------------------------------------------
inline
return true;
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);
void USER_IPS::Add(const IP_MASK &im)
{
ips.push_back(im);