void CreateDummyFolderWithFiles(const String& folder) { TestEnsure(Path::CreateDir(folder)); CreateDummyFile(folder + Path::sep + "fileA"); CreateDummyFile(folder + Path::sep + "fileB"); CreateDummyFile(folder + Path::sep + "fileC"); }
bool FileManager::OpenFile(fstream &file, string filename, int mode, bool create) { if (file.is_open()) { return true; } file.open(filename, (std::ios_base::openmode)mode); if (!create) { return file.is_open(); } if (!file.is_open()) { CreateDummyFile(filename); return OpenFile(file, filename, (ios_base::openmode)mode, false); } return true; }