Import the hdbObject value as a JSON. Note that the JSON must be compatible with the native data class.

Return TypeFunction nameArguments
hzEcodehdbObject::ImportJSON(hzChain&,)

Declared in file: hzDatabase.h
Defined in file : hdbObject.cpp

Function Logic:

0:START 1:unknown 2:Return E_NOINIT 3:unknown 4:Return E_NODATA 5:items zi 6:unknown 7:Return E_FORMAT 8:unknown 9:m_pRoot 10:rc 11:unknown 12:items items items 13:Return rc

Function body:

hzEcode hdbObject::ImportJSON (hzChain& J)
{
   //  Import the hdbObject value as a JSON. Note that the JSON must be compatible with the native data class.
   //  
   //  Arguments: 1) J The JSON as hzChain
   //  
   //  Returns: E_NOINIT If this hdbObject is not initialized
   //     E_NODATA If the supplied JSON is empty
   //     E_FORMAT If the JSON does not comply with the data class
   //     E_OK  Operation successful
   _hzfunc("hdbObject::ImportJSON") ;
   hzChain     err ;       //  Gather all errors
   chIter      zi ;        //  Chain iterator
   hzEcode     rc ;        //  Return code
   if (!m_pClass)  return E_NOINIT ;
   if (!J.Size())  return E_NODATA ;
   Clear() ;
   zi = J ;
   if (*zi != CHAR_CUROPEN)
       return E_FORMAT ;
   if (!m_pRoot)
       m_pRoot = _obj_data::GetInstance(m_pClass) ;
   rc = _import_json_r(err, zi, m_pRoot) ;
   if (rc != E_OK)
       { threadLog("START IMPORT ERROR\n") ; threadLog(err) ; threadLog("END IMPORT ERROR\n") ; }
   return rc ;
}