]> git.donarmstrong.com Git - mothur.git/blobdiff - readtree.h
more calculator edits and added coverage and whittaker
[mothur.git] / readtree.h
index d363cd6884835558fba84e9ebaad678c4efe21b5..3df0e0a5f1312aaf3be2ee1f0c35bc5c93afb695 100644 (file)
@@ -11,8 +11,7 @@
 
 using namespace std;
 
-#include <string>
-#include <iostream>
+#include "mothur.h"
 #include "globaldata.hpp"
 #include "tree.h"
 
@@ -28,19 +27,16 @@ class ReadTree {
                ReadTree(); 
                ~ReadTree() {};
                
-               virtual void read() {};
+               virtual int read() = 0;
                int readSpecialChar(istream&, char, string);
                int readNodeChar(istream& f);
                float readBranchLength(istream& f);
-
-                               
-               Tree* getTree()  { return T; }
                
-               int numNodes, numLeaves;
+       protected:
                GlobalData* globaldata;
+               int numNodes, numLeaves;
+               
                
-       protected:
-               Tree* T;
 };
 
 /****************************************************************************/
@@ -48,16 +44,22 @@ class ReadTree {
 class ReadNewickTree : public ReadTree {
        
 public:
-       ReadNewickTree(string file) : treeFile(file) { openInputFile(file, filehandle); }
+       ReadNewickTree(string file) : treeFile(file) { openInputFile(file, filehandle); readOk = 0; } 
        ~ReadNewickTree() {};
-       void read();
+       int read();
        
 private:
+       Tree* T;
        int readNewickInt(istream&, int&, Tree*);
+       int readTreeString();
+       void nexusTranslation();
        ifstream filehandle;
        string treeFile;
+       string holder;
+       int readOk;  // readOk = 0 means success, readOk = 1 means errors.
+       
 };
 
 /****************************************************************************/
 
-#endif
\ No newline at end of file
+#endif