Return TypeFunction nameArguments
hzEcodehzDocHtml::Export(const hzString&,)

Declared in file: hzDocument.h
Defined in file : hzDocHtml.cpp

Function Logic:

0:START 1:!filepath 2:Return hzerr(E_ARGUMENT,No pathname supplied) 3:!m_pRoot 4:!m_Content.Size() 5:Return hzerr(E_NODATA,Empty page (no root node). Nothing written to file %s\n,*filepath) 6:ofstream::clear ofstream::open ofstream::fail 7:os.fail() 8:Return hzerr(E_OPENFAIL,Could not open file %s\n,*filepath) 9:m_Info.m_urlReq 10:hzChain::Printf 11:*m_Info.m_urlAct 12:hzChain::Printf 13:items ofstream::fail 14:os.fail() 15:rc 16:hzChain::Clear 17:rc==E_OK 18:m_pRoot 19:hzDocHtml::_xport rc 20:Z 21:items ofstream::fail 22:os.fail() 23:rc 24:close 25:Return rc

Function body:

hzEcode hzDocHtml::Export (const hzString& filepath)
{
   _hzfunc("hzDocHtml::Export") ;
   ofstream    os ;
   hzChain     Z ;
   hzEcode     rc = E_OK ;
   if (!filepath)
       return hzerr(E_ARGUMENT, "No pathname supplied") ;
   if (!m_pRoot)
   {
       if (!m_Content.Size())
           return hzerr(E_NODATA, "Empty page (no root node). Nothing written to file %s\n", *filepath) ;
   }
   os.clear() ;
   os.open(*filepath) ;
   if (os.fail())
       return hzerr(E_OPENFAIL, "Could not open file %s\n", *filepath) ;
   if (m_Info.m_urlReq)
       Z.Printf("URL (req): %s\n", *m_Info.m_urlReq) ;
   if (*m_Info.m_urlAct)
       Z.Printf("URL (act): %s\n", *m_Info.m_urlAct) ;
   os << Z ;
   if (os.fail())
       rc = E_WRITEFAIL ;
   Z.Clear() ;
   if (rc == E_OK)
   {
       if (m_pRoot)
           rc = _xport(Z, m_pRoot) ;
       else
           Z = m_Content ;
       os << Z ;
       if (os.fail())
           rc = E_WRITEFAIL ;
   }
   os.close() ;
   return rc ;
}