5 : fp(fopen(inf,
"rt")),
13 throw_errorf(1,
"can't read input file '%s' (Reason: %s)", inf, strerror(errno));
29 exc->replace_msg(file->
lineError(exc->get_msg()).c_str());
45 if (!file->
getLine(next_line)) {
49 size_t len = next_line.length();
53 memcpy(lbuf, next_line.c_str(), 200-4);
54 strcpy(lbuf+200-4,
"...");
57 memcpy(linebuf, next_line.c_str(), len);
74 , checked_written(
false)
77 ofp = fopen(outname,
"wt");
79 throw_errorf(2,
"can't write output file '%s' (Reason: %s)", outname, strerror(errno));
84 bool fine = is_fine();
86 #if defined(ENFORCE_CHECKED_WRITTEN)
91 if (!fine) unlink(filename);
98 #if defined(ENFORCE_CHECKED_WRITTEN)
100 checked_written =
true;
102 if (is_fine() && !written) {
108 throw_errorf(41,
"Write error: %s(=%i) while writing %s",
109 strerror(errno), errno,
name());
115 int printed =
vfprintf(ofp, format, parg);
125 int printed = vsprintf(buffer, format, parg);
FileWriter(const char *outf)
AliDataPtr format(AliDataPtr data, const size_t wanted_len, GB_ERROR &error)
#define implicated(hypothesis, conclusion)
void throw_errorf(int error_num, const char *error_messagef,...) __ATTR__FORMAT(2) __ATTR__NORETURN
bool getLine(string &line)
char * ARB_strdup(const char *str)
char buffer[MESSAGE_BUFFERSIZE]
void showFilenameInLineError(bool show)
string lineError(const string &msg) const
virtual void out(char ch)=0
virtual int outf(const char *format,...) __ATTR__FORMAT_MEMBER(1)
GB_write_int const char GB_write_autoconv_string WRITE_SKELETON(write_pointer, GBDATA *,"%p", GB_write_pointer) char *AW_awa if)(!gb_var) return strdup("")
vfprintf(stderr, format, parg)
virtual void throw_write_error() const __ATTR__NORETURN
static const Convaln_exception * exception_thrown()
virtual const char * name() const =0
#define ENFORCE_CHECKED_WRITTEN
void log_processed(int seqCount)
int outf(const char *format,...) OVERRIDE __ATTR__FORMAT_MEMBER(1)