| 1 | // ============================================================= // |
|---|
| 2 | // // |
|---|
| 3 | // File : seqio.hxx // |
|---|
| 4 | // Purpose : // |
|---|
| 5 | // // |
|---|
| 6 | // Institute of Microbiology (Technical University Munich) // |
|---|
| 7 | // http://www.arb-home.de/ // |
|---|
| 8 | // // |
|---|
| 9 | // ============================================================= // |
|---|
| 10 | |
|---|
| 11 | #ifndef SEQIO_HXX |
|---|
| 12 | #define SEQIO_HXX |
|---|
| 13 | |
|---|
| 14 | #ifndef ARBDB_BASE_H |
|---|
| 15 | #include <arbdb_base.h> |
|---|
| 16 | #endif |
|---|
| 17 | #ifndef ARB_MSG_H |
|---|
| 18 | #include <arb_msg.h> |
|---|
| 19 | #endif |
|---|
| 20 | #ifndef SMARTPTR_H |
|---|
| 21 | #include <smartptr.h> |
|---|
| 22 | #endif |
|---|
| 23 | |
|---|
| 24 | class AP_filter; |
|---|
| 25 | |
|---|
| 26 | namespace SEQIO { |
|---|
| 27 | |
|---|
| 28 | enum ExportWhich { |
|---|
| 29 | EBF_ALL, |
|---|
| 30 | EBF_MARKED, |
|---|
| 31 | EBF_ONE, // export explicitely specified species |
|---|
| 32 | }; |
|---|
| 33 | |
|---|
| 34 | inline void appendTo(char*& content, char sep, char*& toAppend) { |
|---|
| 35 | if (content) { |
|---|
| 36 | freeset(content, GBS_global_string_copy("%s%c%s", content, sep, toAppend)); |
|---|
| 37 | freenull(toAppend); |
|---|
| 38 | } |
|---|
| 39 | else { |
|---|
| 40 | reassign(content, toAppend); |
|---|
| 41 | } |
|---|
| 42 | } |
|---|
| 43 | |
|---|
| 44 | bool read_string_pair(FILE *in, char *&s1, char *&s2, size_t& lineNr); |
|---|
| 45 | char *fgets_smartLF(char *s, int size, FILE *stream); |
|---|
| 46 | |
|---|
| 47 | GB_ERROR export_by_format(GBDATA *gb_main, ExportWhich which, const char *one_species, |
|---|
| 48 | AP_filter *filter, int cut_stop_codon, int compress, |
|---|
| 49 | const char *dbname, const char *formname, const char *field_transfer_set, |
|---|
| 50 | const char *outname, int multiple, char **real_outname); |
|---|
| 51 | |
|---|
| 52 | struct ExportFormatInfo { |
|---|
| 53 | SmartCharPtr suffix; // default output file suffix (optional) |
|---|
| 54 | SmartCharPtr description; // description (optional) |
|---|
| 55 | }; |
|---|
| 56 | |
|---|
| 57 | GB_ERROR get_exportFormat_information(const char *eft_formname, ExportFormatInfo& info); |
|---|
| 58 | char *get_exportFormat_evalForm(const char *eft_formname, GB_ERROR& error); |
|---|
| 59 | }; |
|---|
| 60 | |
|---|
| 61 | #else |
|---|
| 62 | #error seqio.hxx included twice |
|---|
| 63 | #endif // SEQIO_HXX |
|---|