]> git.donarmstrong.com Git - mothur.git/blobdiff - readtree.h
bugs fixes while testing for 1.5 release
[mothur.git] / readtree.h
index 653a853c5f300de0886205217a6b8d99682627b6..0cdf8b1fb8b426f6e358143e492a7c6cae64146e 100644 (file)
@@ -9,12 +9,8 @@
  *
  */
 
-using namespace std;
-
-#include <string>
-#include <iostream>
+#include "mothur.h"
 #include "globaldata.hpp"
-#include "utilities.hpp"
 #include "tree.h"
 
 #define MAX_LINE               513
@@ -27,9 +23,9 @@ class Tree;
 class ReadTree {
        public:
                ReadTree(); 
-               ~ReadTree() {};
+               virtual ~ReadTree() {};
                
-               virtual void read() {};
+               virtual int read() = 0;
                int readSpecialChar(istream&, char, string);
                int readNodeChar(istream& f);
                float readBranchLength(istream& f);
@@ -38,6 +34,7 @@ class ReadTree {
                GlobalData* globaldata;
                int numNodes, numLeaves;
                
+               
 };
 
 /****************************************************************************/
@@ -45,18 +42,20 @@ 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*);
-       void readTreeString();
+       int readTreeString();
        void nexusTranslation();
        ifstream filehandle;
        string treeFile;
        string holder;
+       int readOk;  // readOk = 0 means success, readOk = 1 means errors.
+       
 };
 
 /****************************************************************************/