Return true if this hzEmaddr instance is lexically less than the operand. Note that comparison is first done on the domain part (the RHS of the @) and then done on the address part (the LHS of the @)
| Return Type | Function name | Arguments |
|---|---|---|
| bool | hzEmaddr::operator< | (hzEmaddr&,) |
Declared in file: hzEmaddr.h
Defined in file : hzEmaddr.cpp
Function Logic:
Function body:
bool hzEmaddr::operator< (hzEmaddr& E)
{
// Return true if this hzEmaddr instance is lexically less than the operand. Note that comparison is first done on the domain part (the RHS
// of the @) and then done on the address part (the LHS of the @)
//
// Arguments: 1) E Test email address
//
// Returns: True If this addesss is lexically less than the supplied test email address
// False Otherwise
_hzfunc("hzEmaddr::operator<") ;
int32_t res ; // Comparison result
// Are this and the operand connected?
if (m_addr == E.m_addr) return false ;
if (m_addr && E.m_addr == 0)return false ;
if (E.m_addr && m_addr == 0)return true ;
// Compare domains first
res = strcmp(GetDomain(), E.GetDomain()) ;
if (res < 0)
return true ;
if (res > 0)
return false ;
// Domains are equal so compare LHS
res = _lhscompare(GetAddress(), *E) ;
return res < 0? true : false ;
}