]> git.donarmstrong.com Git - mothur.git/blobdiff - readtree.h
Merge remote-tracking branch 'origin/master'
[mothur.git] / readtree.h
index d363cd6884835558fba84e9ebaad678c4efe21b5..6b074de839070a86bd3e010bbf222a7ec4011dce 100644 (file)
@@ -9,11 +9,7 @@
  *
  */
 
-using namespace std;
-
-#include <string>
-#include <iostream>
-#include "globaldata.hpp"
+#include "mothur.h"
 #include "tree.h"
 
 #define MAX_LINE               513
@@ -26,21 +22,23 @@ class Tree;
 class ReadTree {
        public:
                ReadTree(); 
-               ~ReadTree() {};
+               virtual ~ReadTree() {};
                
-               virtual void read() {};
+               virtual int read(TreeMap*) = 0;
                int readSpecialChar(istream&, char, string);
                int readNodeChar(istream& f);
                float readBranchLength(istream& f);
-
-                               
-               Tree* getTree()  { return T; }
+       
+               vector<Tree*> getTrees() { return Trees; }
+               int AssembleTrees(map<string, string>);
                
+       protected:
+               vector<Tree*> Trees;
+               TreeMap* treeMap;
                int numNodes, numLeaves;
-               GlobalData* globaldata;
+               MothurOut* m;
+               
                
-       protected:
-               Tree* T;
 };
 
 /****************************************************************************/
@@ -48,16 +46,22 @@ class ReadTree {
 class ReadNewickTree : public ReadTree {
        
 public:
-       ReadNewickTree(string file) : treeFile(file) { openInputFile(file, filehandle); }
+       ReadNewickTree(string file) : treeFile(file) { m->openInputFile(file, filehandle); readOk = 0; } 
        ~ReadNewickTree() {};
-       void read();
+       int read(TreeMap*);
        
 private:
-       int readNewickInt(istream&, int&, Tree*);
+       Tree* T;
+       int readNewickInt(istream&, int&, Tree*, TreeMap*);
+       int readTreeString(TreeMap*);
+       string nexusTranslation(TreeMap*);
        ifstream filehandle;
        string treeFile;
+       string holder;
+       int readOk;  // readOk = 0 means success, readOk = 1 means errors.
+       
 };
 
 /****************************************************************************/
 
-#endif
\ No newline at end of file
+#endif