本文整理汇总了C++中IPAddress::GetAddress1方法的典型用法代码示例。如果您正苦于以下问题:C++ IPAddress::GetAddress1方法的具体用法?C++ IPAddress::GetAddress1怎么用?C++ IPAddress::GetAddress1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPAddress
的用法示例。
在下文中一共展示了IPAddress::GetAddress1方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
bool
LocalIPAddresses::IsWithinLoopbackRange(const IPAddress &address)
{
if (address.GetType() == IPAddress::IPV4)
{
unsigned __int64 longAddress = address.GetAddress1();
// 127.0.0.1 - 127.255.255.255
if (longAddress >= 2130706433 && longAddress <= 2147483647)
return true;
else
return false;
}
else if (address.GetType() == IPAddress::IPV6)
{
if (address.GetAddress1() == 0 && address.GetAddress2() == 1)
return true;
else
return false;
}
return true;
/*
*/
}
示例2:
bool
IPAddress::operator<(const IPAddress &other)
{
bool inputIsGreater =
other.GetAddress1() > GetAddress1() ||
(other.GetAddress1() == GetAddress1() && other.GetAddress2() > GetAddress2());
return inputIsGreater;
}
示例3:
AnsiString
IPAddressSQLHelper::GetAddress1Equals(const IPAddress &address) const
{
String s;
s.Format(_T("= %I64d"), address.GetAddress1());
return s;
}
示例4: ToString
bool
IPAddress::WithinRange(const IPAddress &lower, const IPAddress &upper) const
{
#ifdef _DEBUG
String lower1 = lower.ToString();
String lower2 = upper.ToString();
String thisIP = ToString();
#endif
if (GetAddress1() < lower.GetAddress1() || GetAddress1() > upper.GetAddress1())
return false;
// If it's an IPv4 address, we don't need to compare the second part.
if (_address.is_v4())
return true;
if (GetAddress2() < lower.GetAddress2() || GetAddress2() > upper.GetAddress2())
return false;
return true;
}