*
*/
-using namespace std;
-
-#include <string>
-#include <iostream>
+#include "mothur.h"
#include "globaldata.hpp"
-#include "utilities.hpp"
#include "tree.h"
#define MAX_LINE 513
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);
protected:
GlobalData* globaldata;
int numNodes, numLeaves;
+ MothurOut* m;
+
};
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*);
- void readTreeString();
+ int readTreeString();
void nexusTranslation();
ifstream filehandle;
string treeFile;
string holder;
+ int readOk; // readOk = 0 means success, readOk = 1 means errors.
+
};
/****************************************************************************/