Return Type | Function name | Arguments |
---|---|---|
hzEcode | hdbADP::InitSiteIndex | (const hzString&,) |
Declared in file: hzDatabase.h
Defined in file : hdbClass.cpp
Function Logic:
Function body:
hzEcode hdbADP::InitSiteIndex (const hzString& dataDir) { _hzfunc("hdbADP::InitSiteIndex") ; hdbClass* pClass ; hdbObjRepos* pRepos ; hzString S ; hzEcode rc ; if (!this) hzexit(E_CORRUPT, "No ADP instance") ; if (m_pSiteindex) return hzerr(E_SEQUENCE, "This function has already been called") ; if (!dataDir) return hzerr(E_ARGUMENT, "No application data directory") ; S = "siteindex" ; m_pSiteindex = new hdbIndexText() ; pClass = new hdbClass(*this, HDB_CLASS_DESIG_SYS) ; rc = pClass->InitStart(S) ; if (rc == E_OK) { S = "pageUrl" ; rc = pClass->InitMember(S, datatype_STRING, HDB_MBR_POP_SINGLE_COMPULSORY) ; } if (rc == E_OK) { S = "PageTitle" ; rc = pClass->InitMember(S, datatype_STRING, HDB_MBR_POP_SINGLE_COMPULSORY) ; } if (rc == E_OK) { rc = pClass->InitDone() ; } if (rc == E_OK) rc = RegisterDataClass(pClass) ; if (rc != E_OK) hzexit(rc, "Could not init subsriber class") ; pRepos = new hdbObjRepos(*this) ; if (!pRepos) hzexit(E_MEMORY, "No subsciber cache allocated") ; rc = pRepos->InitStart(pClass, pClass->strType(), dataDir, HDB_REPOS_CACHE) ; if (rc != E_OK) hzexit(rc, "Could not init subsriber repos") ; S = "pageUrl" ; rc = pRepos->InitMbrIndex(S, true) ; if (rc != E_OK) hzexit(rc, "Could not init subsriber repos index") ; rc = pRepos->InitDone() ; if (rc != E_OK) hzexit(rc, "Could not complete subsriber repos initialization") ; threadLog("Complete subsriber repos initialization") ; rc = m_mapRepositories.Insert(pRepos->strName(), pRepos) ; threadLog("Subscriber Repos Reg complete\n") ; return rc ; }