Return Type | Function name | Arguments |
---|---|---|
hzEcode | hzDocHtml::Export | (const hzString&,) |
Declared in file: hzDocument.h
Defined in file : hzDocHtml.cpp
Function Logic:
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 ; }