FileForJUnitOutputTests* file(const char* filename) { for (FileForJUnitOutputTests* current = firstFile_; current != NULL; current = current->nextFile()) if (current->name() == filename) return current; return NULL; }
~FileSystemForJUnitTestOutputTests() { while (firstFile_) { FileForJUnitOutputTests* fileToBeDeleted = firstFile_; firstFile_ = firstFile_->nextFile(); delete fileToBeDeleted; } }
void clear(void) { while (firstFile_) { FileForJUnitOutputTests* fileToBeDeleted = firstFile_; firstFile_ = firstFile_->nextFile(); delete fileToBeDeleted; } }
void closeFile() { currentOpenFile_->close(); currentOpenFile_ = 0; }
void writeToFile(const SimpleString& buffer) { currentOpenFile_->write(buffer); }
int amountOfFiles() { int totalAmountOfFiles = 0; for (FileForJUnitOutputTests* current = firstFile_; current != NULL; current = current->nextFile()) totalAmountOfFiles++; return totalAmountOfFiles; }