#include "common.h" #include "ZCatScanner.h" // No jokes about the name, please. ZCatScanner::ZCatScanner() : out(0) { } ZCatScanner::~ZCatScanner() { if (out) { fclose(out); out = 0; } } bool ZCatScanner::openTo(const char* sFilename) { out = fopen(sFilename,"w"); if (out) { VERIFY(0 == ::setvbuf(out,0,_IOFBF,51200)); return true; } onError(sFilename,errno); return false; } void ZCatScanner::onLine(const char* sLine) { ++nLines; cbFile += strlen(sLine); fputs(sLine,out); fputc('\n',out); }