1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
#ifndef FASTAWRITER_H
#define FASTAWRITER_H 1
#include "Common/Sequence.h"
#include <cstdio>
/** Output a FASTA file. */
class FastaWriter {
public:
// Constructor opens file
FastaWriter(const char* path, bool append = false);
// Destructor closes it
~FastaWriter();
/** Write a sequence with a comment. */
void WriteSequence(const Sequence& seq, unsigned id,
unsigned multiplicity, const std::string& comment);
/** Write a sequence. */
void WriteSequence(const Sequence& seq, unsigned id,
unsigned multiplicity)
{
WriteSequence(seq, id, multiplicity, "");
}
void WriteSequence(const Sequence& seq, unsigned long long id,
const std::string& comment);
void WriteSequence(const Sequence& seq, const std::string& id,
const std::string& comment);
private:
const char *m_path;
FILE* m_fileHandle;
};
#endif
|