X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=readtree.h;h=0cdf8b1fb8b426f6e358143e492a7c6cae64146e;hb=99bd02d78eaf21b01420c6f99e38efc7fa4e9e17;hp=bee4d94a683966e76922269326728ca2e71bd72f;hpb=bfbc55964f1977da72c2cea984288a427d370a59;p=mothur.git diff --git a/readtree.h b/readtree.h index bee4d94..0cdf8b1 100644 --- a/readtree.h +++ b/readtree.h @@ -9,10 +9,8 @@ * */ -using namespace std; - +#include "mothur.h" #include "globaldata.hpp" -#include "utilities.hpp" #include "tree.h" #define MAX_LINE 513 @@ -25,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); @@ -36,6 +34,7 @@ class ReadTree { GlobalData* globaldata; int numNodes, numLeaves; + }; /****************************************************************************/ @@ -43,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. + }; /****************************************************************************/