]> git.donarmstrong.com Git - mothur.git/blobdiff - readtree.h
changing command name classify.shared to classifyrf.shared
[mothur.git] / readtree.h
index 02b6129b21b0bc960e1d16f9d028baab374bb465..8a692432c7cda431c6f5d73f409a0fa8e9152671 100644 (file)
@@ -9,12 +9,9 @@
  *
  */
 
-using namespace std;
-
-#include <string>
-#include <iostream>
-#include "globaldata.hpp"
+#include "mothur.h"
 #include "tree.h"
+#include "counttable.h"
 
 #define MAX_LINE               513
 #define SKIPLINE(f,c)  {while((c=f.get())!=EOF && ((c) != '\n')){}}
@@ -26,16 +23,22 @@ class Tree;
 class ReadTree {
        public:
                ReadTree(); 
-               ~ReadTree() {};
+               virtual ~ReadTree() {};
                
-               virtual void read() {};
+               virtual int read(CountTable*) = 0;
                int readSpecialChar(istream&, char, string);
                int readNodeChar(istream& f);
                float readBranchLength(istream& f);
+       
+               vector<Tree*> getTrees() { return Trees; }
+               int AssembleTrees();
                
        protected:
-               GlobalData* globaldata;
+               vector<Tree*> Trees;
+               CountTable* ct;
                int numNodes, numLeaves;
+               MothurOut* m;
+               
                
 };
 
@@ -44,18 +47,20 @@ 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(CountTable*);
        
 private:
        Tree* T;
-       int readNewickInt(istream&, int&, Tree*);
-       void readTreeString();
-       void nexusTranslation();
+       int readNewickInt(istream&, int&, Tree*, CountTable*);
+       int readTreeString(CountTable*);
+       string nexusTranslation(CountTable*);
        ifstream filehandle;
        string treeFile;
        string holder;
+       int readOk;  // readOk = 0 means success, readOk = 1 means errors.
+       
 };
 
 /****************************************************************************/