| Return Type | Function name | Arguments |
|---|---|---|
| hzEcode | hzHttpEvent::Storeform | (const char*,) |
Declared in file: hzHttpServer.h
Defined in file : hzHttpServer.cpp
Function Logic:
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 ;
}