source: branches/port5/SL/TREE_WRITE/TreeWrite.h

Last change on this file was 6066, checked in by westram, 16 years ago
  • Added two options to Tree-Exporter
    • quoting style (none/single/double)
    • replace problem chars, currently "()[]:;," plus used quote
  • added quote-mode to TREE_write_Newick()
  • changes to previous behavior
    • if a label (e.g. from NDS) contains a single quote (') it now gets replaced by '_'. Before ARB wrote two single quotes.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.1 KB
Line 
1// ============================================================ //
2//                                                              //
3//   File      : TreeWrite.h                                    //
4//   Purpose   :                                                //
5//                                                              //
6//   Institute of Microbiology (Technical University Munich)    //
7//   www.arb-home.de                                            //
8//                                                              //
9// ============================================================ //
10
11#ifndef TREEWRITE_H
12#define TREEWRITE_H
13
14typedef void        (*TREE_make_node_text_init)(GBDATA *gb_main);
15typedef const char *(*TREE_make_node_text)     (GBDATA *gb_main, GBDATA * gbd, int mode, GBT_TREE *species, const char *tree_name);
16
17struct TREE_node_text_gen {
18    TREE_make_node_text_init init;                  // e.g. make_node_text_init() from AWT
19    TREE_make_node_text      gen;                   // e.g. make_node_text_nds() from AWT
20
21    TREE_node_text_gen(TREE_make_node_text_init init_, TREE_make_node_text gen_)
22        : init(init_)
23        , gen(gen_)
24    {}
25};
26
27enum TREE_node_quoting {
28    TREE_DISALLOW_QUOTES = 0, // don't use quotes
29    TREE_SINGLE_QUOTES   = 1, // use single quotes
30    TREE_DOUBLE_QUOTES   = 2, // use double quotes
31
32    TREE_FORCE_QUOTES  = 4, // force usage of quotes
33    TREE_FORCE_REPLACE = 8, // replace all problematic characters (default is to replace quotes in quoted labels)
34};
35
36GB_ERROR TREE_write_Newick(GBDATA *gb_main, char *tree_name, const TREE_node_text_gen *node_gen, bool save_branchlengths, bool save_bootstraps, bool save_groupnames, bool pretty, TREE_node_quoting quoteMode, char *path);
37GB_ERROR TREE_write_XML(GBDATA *gb_main, const char *db_name, const char *tree_name, const TREE_node_text_gen *node_gen, bool skip_folded, const char *path);
38GB_ERROR TREE_export_tree(GBDATA *gb_main,FILE *out,GBT_TREE *tree, bool triple_root, bool export_branchlens, bool use_double_quotes);
39
40#else
41#error TreeWrite.h included twice
42#endif // TREEWRITE_H
Note: See TracBrowser for help on using the repository browser.