void CmFile::CleanFolder(CStr& dir, bool subFolder) { vecS names; int fNum = CmFile::GetNames(dir + "/*.*", names); for (int i = 0; i < fNum; i++) RmFile(dir + "/" + names[i]); vecS subFolders; int subNum = GetSubFolders(dir, subFolders); if (subFolder) for (int i = 0; i < subNum; i++) CleanFolder(dir + "/" + subFolders[i], true); }
void IMVLFile::CleanFolder(const string& dir, bool subFolder) { vector<string> names; int fNum = IMVLFile::GetNames(dir + "/*.*", names); for (int i = 0; i < fNum; i++) RmFile(dir + "/" + names[i]); vector<string> subFolders; int subNum = GetSubFolders(dir, subFolders); if (subFolder) for (int i = 0; i < subNum; i++) CleanFolder(dir + "/" + subFolders[i], true); }