bool CheckFileList() { CCZFileSystem *pfs=ZApplication::GetFileSystem(); CCZFile mzf; string strFileNameFillist(FILENAME_FILELIST); if(!mzf.Open(strFileNameFillist.c_str() ,pfs)) return false; char *buffer; buffer=new char[mzf.GetLength()+1]; mzf.Read(buffer,mzf.GetLength()); buffer[mzf.GetLength()]=0; CCXmlDocument aXml; aXml.Create(); if(!aXml.LoadFromMemory(buffer)) { delete buffer; return false; } delete buffer; int iCount, i; ::CCXmlElement aParent, aChild; aParent = aXml.GetDocumentElement(); iCount = aParent.GetChildNodeCount(); char szTagName[256]; for (i = 0; i < iCount; i++) { aChild = aParent.GetChildNode(i); aChild.GetTagName(szTagName); if(stricmp(szTagName,"FILE")==0) { char szContents[256],szCrc32[256]; aChild.GetAttribute(szContents,"NAME"); aChild.GetAttribute(szCrc32,"CRC32"); if(stricmp(szContents,"config.xml")!=0) { unsigned int crc32_list = pfs->GetCRC32(szContents); unsigned int crc32_current; sscanf(szCrc32,"%x",&crc32_current); } } } return true; }
void ZApplication::InitFileSystem() { m_FileSystem.Create("./","update"); m_FileSystem.SetPrivateKey( szPrivateKey, sizeof( szPrivateKey)); string strFileNameFillist(FILENAME_FILELIST); // #ifndef _DEBUG // strFileNameFillist += ".mef"; // // m_fileCheckList.Open(strFileNameFillist.c_str(), &m_FileSystem); // m_FileSystem.SetFileCheckList(&m_fileCheckList); // #endif RSetFileSystem(ZApplication::GetFileSystem()); }