Assign the hzDomain to an domain name held in a character string Note: This function will record an E_FORMAT error if the supplied cstr did not amount to an domain name

Return TypeFunction nameArguments
hzDomain&hzDomain::operator=(const char*,)

Declared in file: hzEmaddr.h
Defined in file : hzDomain.cpp

Function Logic:

0:START 1:items 2:unknown 3:Return *this 4:nLen 5:unknown 6:items 7:Return *this 8:m_addr 9:unknown 10:items 11:destCtl destCtl nLen destCtl nLP destCtl 12:unknown 13:* 14:Return *this

Function body:

hzDomain& hzDomain::operator= (const char* cpStr)
{
   //  Assign the hzDomain to an domain name held in a character string
   //  
   //  Arguments: 1) cpStr A null terminated string assumed to be an domain name
   //  
   //  Returns: Reference to this email adress instance in all cases.
   //  
   //  Note: This function will record an E_FORMAT error if the supplied cstr did not amount to an domain name
   _hzfunc("hzDomain::operator=(cstr)") ;
   _domItem*   destCtl ;       //  This domain name space
   const char* i ;             //  Email iterator
   char*       j ;             //  Email iterator
   uint32_t    nLen = 0;       //  Length of domain name
   uint32_t    nLP = 0;        //  Offset to last period
   Clear() ;
   if (!cpStr || !cpStr[0])
       return *this ;
   nLen = _ckDomain(nLP, cpStr) ;
   if (!nLen)
   {
       hzerr(E_FORMAT, "Cannot assign %s", cpStr) ;
       return *this ;
   }
   m_addr = _domAlloc(nLen + DOM_FACTOR) ;
   if (!m_addr)
       hzexit(E_MEMORY, "Cannot assign %s", cpStr) ;
   destCtl = _domXlate(m_addr) ;
   //  Assign the value
   destCtl->m_copy = 1;
   destCtl->m_len = nLen & 0xff;
   destCtl->m_tld = nLP & 0xff;
   for (j = destCtl->m_data, i = cpStr ; *i ; *j++ = _tolower(*i++)) ;
   *j = 0;
   return *this ;
}