inline void printBegin(const char *kw, const char *inp_dlm=NULL, const char *inp_name_dlm=NULL, int indent=0) { if (o == NULL) return; dlm = inp_dlm; name_dlm = inp_name_dlm; if (name_dlm == NULL) name_dlm = dlm; if (indent > 0) { /* indentation */ AzBytArr s; s.fill(' ', indent); *o<<s.c_str(); } if (kw != NULL && strlen(kw) > 0) { *o<<kw<<": "; } count = 0; }
/*-------------------*/ void toplevel_header(const char *desc, AzByte dlm='*') { if (out.isNull()) return; newline(); AzBytArr s; s.fill(dlm, 3); int dlm_len = Az64::cstrlen(desc) + s.length()*2; dlm_len = MIN(line_width, dlm_len); AzBytArr s_long; s_long.fill(dlm, dlm_len); AzPrint::writeln(out, s_long.c_str()); AzPrint::write(out, s.c_str()); AzPrint::write(out, desc); AzPrint::writeln(out, s.c_str()); AzPrint::writeln(out, s_long.c_str()); }
inline void print_space(int len) { AzBytArr s; s.fill(' ', len); print(s); }