void TZipOut::Flush(){ FlushBf(); #ifdef GLib_WIN EAssertR(FlushFileBuffers(ZipStdinWr)!=0, "Can not flush file '"+GetSNm()+"'."); #else EAssertR(fflush(ZipStdinWr)==0, "Can not flush file '"+GetSNm()+"'."); #endif }
TZipOut::~TZipOut() { if (BfL!=0) { FlushBf(); } #ifdef GLib_WIN if (ZipStdinWr != NULL) { EAssertR(CloseHandle(ZipStdinWr), "Closing write-end of pipe failed"); } if (ZipStdinRd != NULL) { EAssertR(CloseHandle(ZipStdinRd), "Closing read-end of pipe failed"); } #else if (ZipStdinWr != NULL) { EAssertR(pclose(ZipStdinWr) != -1, "Closing of the process failed"); } #endif if (Bf!=NULL) { delete[] Bf; } }
void TFOut::Flush(){ FlushBf(); EAssertR(fflush(FileId)==0, "Can not flush file '"+GetSNm()+"'."); }
int TFOut::PutCh(const char& Ch){ if (BfL==TSize(MxBfL)){FlushBf();} return Bf[BfL++]=Ch; }
TFOut::~TFOut(){ if (FileId!=NULL){FlushBf();} if (Bf!=NULL){delete[] Bf;} if (FileId!=NULL){ EAssertR(fclose(FileId)==0, "Can not close file '"+GetSNm()+"'.");} }
int TZipOut::PutCh(const char& Ch){ if (BfL==MxBfL) {FlushBf();} return Bf[BfL++]=Ch; }