bool CWizDatabase::GetChildLocations(const CWizStdStringArray& arrayAllLocation, \ const QString& strLocation, \ CWizStdStringArray& arrayLocation) { if (strLocation.isEmpty()) return GetAllRootLocations(arrayAllLocation, arrayLocation); std::set<QString> setLocation; CWizStdStringArray::const_iterator it; for (it = arrayAllLocation.begin(); it != arrayAllLocation.end(); it++) { const QString& str = *it; if (str.length() > strLocation.length() && str.startsWith(strLocation)) { int index = str.indexOf('/', strLocation.length() + 1); if (index > 0) { QString strChild = str.left(index + 1); setLocation.insert(strChild); } } } arrayLocation.assign(setLocation.begin(), setLocation.end()); return true; }
void CWizSettings::GetKeys(const QString& strSection, CWizStdStringArray& arrayAction) { beginGroup(strSection); QStringList sl = childKeys(); endGroup(); arrayAction.assign(sl.begin(), sl.end()); }
bool CWizDatabase::GetAllRootLocations(const CWizStdStringArray& arrayAllLocation, \ CWizStdStringArray& arrayLocation) { std::set<QString> setRoot; CWizStdStringArray::const_iterator it; for (it = arrayAllLocation.begin(); it != arrayAllLocation.end(); it++) { setRoot.insert(GetRootLocation(*it)); } arrayLocation.assign(setRoot.begin(), setRoot.end()); return true; }
bool CWizHtmlCollector::Html2Zip(const QString& strExtResourcePath, \ const QString& strMetaText, \ const QString& strZipFileName) { //CString strMainHtml(strHtml); //if (!Collect(strUrl, strMainHtml, true)) // return false; std::deque<WIZHTMLFILEDATA> arrayResource; m_files.GetAll(arrayResource); std::set<QString> files; std::deque<WIZHTMLFILEDATA>::const_iterator it; for (it = arrayResource.begin(); it != arrayResource.end(); it++) { files.insert(it->strFileName); } CWizStdStringArray arrayExtResource; if (!strExtResourcePath.isEmpty()) { ::WizEnumFiles(strExtResourcePath, "*.*", arrayExtResource, 0); for (CWizStdStringArray::const_iterator it = arrayExtResource.begin(); it != arrayExtResource.end(); it++) { files.insert(*it); } } CString strRet; ::WizStringArrayToText(m_ret, strRet, ""); CWizStdStringArray arrayAllResource; arrayAllResource.assign(files.begin(), files.end()); return WizHtml2Zip(strRet, arrayAllResource, strMetaText, strZipFileName); }
void CWizSettings::GetSections(CWizStdStringArray& arrayAction) { QStringList sl = childGroups(); arrayAction.assign(sl.begin(), sl.end()); }