Return TypeFunction nameArguments
hzEcodehzHttpEvent::Storeform(const char*,)

Declared in file: hzHttpServer.h
Defined in file : hzHttpServer.cpp

Function Logic:

0:START 1:!cpPath||!cpPath[0] 2:Return hzerr(E_ARGUMENT,No pathname supplied\n) 3:ofstream::open ofstream::fail 4:os.fail() 5:Return hzerr(E_OPENFAIL,Could not open file (%s) for writing\n,cpPath) 6:hzXDate::SysDateTime hzXDate::Year hzXDate::Month hzXDate::Day sprintf items hzXDate::Hour hzXDate::Min hzXDate::Sec sprintf items nIndex 7:GetAt(P,nIndex)==E_OK; 8:P.name&&P.value 9:items ofstream::fail 10:os.fail() 11:close 12:Return E_WRITEFAIL 13:items close 14:Return E_OK

Function body:

hzEcode hzHttpEvent::Storeform (const char* cpPath)
{
   _hzfunc("hzHttpEvent::Storeform") ;
   static  char cvLine [80];
   std::ofstream   os ;
   hzPair      P ;
   hzXDate     now ;
   uint32_t    nIndex ;
   if (!cpPath || !cpPath[0])
       return hzerr(E_ARGUMENT, "No pathname supplied\n") ;
   os.open(cpPath, std::ios::app) ;
   if (os.fail())
       return hzerr(E_OPENFAIL, "Could not open file (%s) for writing\n", cpPath) ;
   now.SysDateTime() ;
   sprintf(cvLine, "@Date: %04d%02d%02d\n", now.Year(), now.Month(), now.Day()) ;
   os << cvLine ;
   sprintf(cvLine, "@Time: %02d%02d%02d\n", now.Hour(), now.Min(), now.Sec()) ;
   os << cvLine ;
   for (nIndex = 0; GetAt(P, nIndex) == E_OK ; nIndex++)
   {
       if (P.name && P.value)
           os << "@" << P.name << ":\t" << P.value << "\n" ;
       if (os.fail())
       {
           os.close() ;
           hzerr(E_WRITEFAIL, "_storeform: Write error on file (%s)\n", cpPath) ;
           return E_WRITEFAIL ;
       }
   }
   os << "@end:\n\n" ;
   os.close() ;
   return E_OK ;
}