]> git.donarmstrong.com Git - mothur.git/blobdiff - readtree.h
fixed summary.shared bug and set jumble default to 1.
[mothur.git] / readtree.h
index 41d03058d6478cb371737dbc385c8bb5d0a1c999..d363cd6884835558fba84e9ebaad678c4efe21b5 100644 (file)
@@ -13,18 +13,51 @@ using namespace std;
 
 #include <string>
 #include <iostream>
+#include "globaldata.hpp"
+#include "tree.h"
 
+#define MAX_LINE               513
+#define SKIPLINE(f,c)  {while((c=f.get())!=EOF && ((c) != '\n')){}}
+
+class Tree;
+
+/****************************************************************************/
 
 class ReadTree {
        public:
-               ReadTree();
-               ~ReadTree();
+               ReadTree(); 
+               ~ReadTree() {};
+               
+               virtual void read() {};
+               int readSpecialChar(istream&, char, string);
+               int readNodeChar(istream& f);
+               float readBranchLength(istream& f);
+
+                               
+               Tree* getTree()  { return T; }
+               
+               int numNodes, numLeaves;
+               GlobalData* globaldata;
                
+       protected:
+               Tree* T;
+};
+
+/****************************************************************************/
+
+class ReadNewickTree : public ReadTree {
        
-       private:
+public:
+       ReadNewickTree(string file) : treeFile(file) { openInputFile(file, filehandle); }
+       ~ReadNewickTree() {};
+       void read();
        
-
+private:
+       int readNewickInt(istream&, int&, Tree*);
+       ifstream filehandle;
+       string treeFile;
 };
 
+/****************************************************************************/
 
 #endif
\ No newline at end of file