XmlOperator::XmlOperator() { doc = gcnew XmlDocument(); //判断文件是否存在,不存在就创建文件 if (!_IsFile()) { Creatfile(); } }
// returns list of *plain* file names in given directory, // without paths, and without anything else void GetFileList(const char *path, StringList& files) { #if !_WIN32 DIR * dirp; struct dirent * dp; dirp = opendir(path); if(dirp) { while((dp=readdir(dirp)) != NULL) { if (_IsFile(path, dp)) // only add if it is not a directory { std::string s(dp->d_name); files.push_back(s); } } closedir(dirp); } # else WIN32_FIND_DATA fil; std::string search(path); MakeSlashTerminated(search); search += "*"; HANDLE hFil = FindFirstFile(search.c_str(),&fil); if(hFil != INVALID_HANDLE_VALUE) { do { if(!(fil.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { std::string s(fil.cFileName); files.push_back(s); } } while(FindNextFile(hFil, &fil)); FindClose(hFil); } # endif }