*
*/
-using namespace std;
-
-#include <string>
-#include <iostream>
+#include "mothur.h"
#include "globaldata.hpp"
#include "tree.h"
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);
-
-
- Tree* getTree() { return T; }
- int numNodes, numLeaves;
+ protected:
GlobalData* globaldata;
+ int numNodes, numLeaves;
+ MothurOut* m;
+
- protected:
- Tree* T;
};
/****************************************************************************/
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();
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