14 const char *name = seq.
get_id();
18 for (
int indi = 0; indi < 10; indi++) write.
out(name[indi]);
26 for (
int indi = 0; indi < bnum; indi++) write.
out(
' ');
29 else if (index >= seq.
get_len()) {
36 const char *sequence = seq.
get_seq();
37 for (
int indi = 0, indj = 0; indi <
length; indi++) {
38 if ((index + indi) < seq.
get_len()) {
39 char c = sequence[index + indi];
45 if (indj == 10 && (index + indi) < (seq.
get_len() - 1) && indi < (length - 1)) {
58 int ch = fgetc(stdin);
80 throw_error(140,
"Cannot write to standard output");
89 int headersize1 = write.
outf(
"%8d %8d", maxsize, current);
94 while (maxsize > current) {
95 for (
int indi = 0; indi < total_seq; indi++) {
102 if (maxsize > current)
110 perror(
"rewind error");
111 throw_errorf(141,
"Failed to rewind file (errno=%i)", errno);
114 int headersize2 = write.
outf(
"%8d %8d", total_seq, maxsize);
116 if (headersize1 != headersize2) {
118 throw_errorf(142,
"Failed to rewrite header (headersize differs: %i != %i)", headersize1, headersize2);
CONSTEXPR_INLINE int str0len(const char *str)
void out(char ch) FINAL_OVERRIDE
void throw_errorf(int error_num, const char *error_messagef,...) __ATTR__FORMAT(2) __ATTR__NORETURN
const char * get_id() const
static void phylip_print_line(const Seq &seq, int index, Writer &write)
void to_phylip(const FormattedFile &in, const char *outf, bool for_fastdnaml)
virtual void out(char ch)=0
CONSTEXPR_INLINE bool is_input_format(Format inType)
const Seq & get(int idx) const
void throw_conversion_not_supported(Format inType, Format ouType)
void throw_error(int error_num, const char *error_message) __ATTR__NORETURN
static void inject_STDIN(FileWriter &write)
void read_alignment(Alignment &ali, const FormattedFile &in)
const char * get_seq() const
int outf(const char *format,...) OVERRIDE __ATTR__FORMAT_MEMBER(1)