Open the hdbBinRepos instance. This is a matter of opening an input and an output stream for both index the data files. Note the output streams are opened with ios::app as they will only ever append. Arguments: None

Return TypeFunction nameArguments
hzEcodehdbBinRepos::Open(void)

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

Function Logic:

0:START 1:unknown 2:items 3:unknown 4:items 5:items 6:unknown 7:Return hzerr(E_OPENFAIL,Cannot open index file for writing: Repos %s,*m_FileIndx) 8:items items 9:unknown 10:Return hzerr(E_OPENFAIL,Could not open file (%s) for writing,*m_FileData) 11:items items 12:unknown 13:Return hzerr(E_OPENFAIL,Could not open index file (%s) for reading,*m_FileIndx) 14:items items 15:unknown 16:Return hzerr(E_OPENFAIL,Could not open data file (%s) for reading,*m_FileData) 17:items items m_nInitState 18:Return E_OK

Function body:

hzEcode hdbBinRepos::Open (void)
{
   //  Open the hdbBinRepos instance.
   //  
   //  This is a matter of opening an input and an output stream for both index the data files. Note the output streams are opened with ios::app as they will only ever append.
   //  
   //  Arguments: None
   //  
   //  Returns: E_NOINIT If the repository has not been initialized
   //     E_SEQUENCE If the repository is already open
   //     E_OPENFAIL If either the index or data file cannot be opened for either reading or writing
   //     E_OK  If the operation was successful
   _hzfunc("hdbBinRepos::Open") ;
   if (m_nInitState == 0)  hzexit(E_NOINIT, "Cannot open an uninitialized datacron") ;
   if (m_nInitState == 2)  hzexit(E_SEQUENCE, "Datacron %s is already open", *m_Name) ;
   m_WrI.open(*m_FileIndx, std::ios::app) ;
   if (m_WrI.fail())
       return hzerr(E_OPENFAIL, "Cannot open index file for writing: Repos %s", *m_FileIndx) ;
   threadLog("Opened index file for writing: Repos %s\n", *m_FileIndx) ;
   m_WrD.open(*m_FileData, std::ios::app) ;
   if (m_WrD.fail())
       return hzerr(E_OPENFAIL, "Could not open file (%s) for writing", *m_FileData) ;
   threadLog("Opened data file for writing: Repos %s\n", *m_FileData) ;
   m_RdI.open(*m_FileIndx) ;
   if (m_RdI.fail())
       return hzerr(E_OPENFAIL, "Could not open index file (%s) for reading", *m_FileIndx) ;
   threadLog("Opened index file for reading: Repos %s\n", *m_FileIndx) ;
   m_RdD.open(*m_FileData) ;
   if (m_RdD.fail())
       return hzerr(E_OPENFAIL, "Could not open data file (%s) for reading", *m_FileData) ;
   threadLog("Opened index file for reading: Repos %s\n", *m_FileData) ;
   threadLog("OPENED %s\n", *m_Name) ;
   m_nInitState = 2;
   return E_OK ;
}