X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=readtree.h;h=6b074de839070a86bd3e010bbf222a7ec4011dce;hb=a6cf29fa4dac0909c7582cb1094151d34093ee76;hp=653a853c5f300de0886205217a6b8d99682627b6;hpb=5e8fcd2454ba4bd2e11983afd682b8aa6f7bb5c2;p=mothur.git diff --git a/readtree.h b/readtree.h index 653a853..6b074de 100644 --- a/readtree.h +++ b/readtree.h @@ -9,12 +9,7 @@ * */ -using namespace std; - -#include -#include -#include "globaldata.hpp" -#include "utilities.hpp" +#include "mothur.h" #include "tree.h" #define MAX_LINE 513 @@ -27,16 +22,22 @@ class Tree; class ReadTree { public: ReadTree(); - ~ReadTree() {}; + virtual ~ReadTree() {}; - virtual void read() {}; + virtual int read(TreeMap*) = 0; int readSpecialChar(istream&, char, string); int readNodeChar(istream& f); float readBranchLength(istream& f); + + vector getTrees() { return Trees; } + int AssembleTrees(map); protected: - GlobalData* globaldata; + vector Trees; + TreeMap* treeMap; int numNodes, numLeaves; + MothurOut* m; + }; @@ -45,18 +46,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(TreeMap*); private: Tree* T; - int readNewickInt(istream&, int&, Tree*); - void readTreeString(); - void nexusTranslation(); + int readNewickInt(istream&, int&, Tree*, TreeMap*); + int readTreeString(TreeMap*); + string nexusTranslation(TreeMap*); ifstream filehandle; string treeFile; string holder; + int readOk; // readOk = 0 means success, readOk = 1 means errors. + }; /****************************************************************************/