#include <string>
#include <iostream>
+#include "globaldata.hpp"
+#include "utilities.hpp"
+#include "tree.h"
+#define MAX_LINE 513
+#define SKIPLINE(f,c) {while((c=f.get())!=EOF && ((c) != '\n')){}}
+
+class Tree;
+
+/****************************************************************************/
class ReadTree {
public:
- ReadTree();
- ~ReadTree();
+ ReadTree();
+ ~ReadTree() {};
+
+ virtual void read() {};
+ int readSpecialChar(istream&, char, string);
+ int readNodeChar(istream& f);
+ float readBranchLength(istream& f);
+
+ protected:
+ GlobalData* globaldata;
+ int numNodes, numLeaves;
+};
+
+/****************************************************************************/
+
+class ReadNewickTree : public ReadTree {
- private:
+public:
+ ReadNewickTree(string file) : treeFile(file) { openInputFile(file, filehandle); }
+ ~ReadNewickTree() {};
+ void read();
-
+private:
+ Tree* T;
+ int readNewickInt(istream&, int&, Tree*);
+ void readTreeString();
+ void nexusTranslation();
+ ifstream filehandle;
+ string treeFile;
+ string holder;
};
+/****************************************************************************/
-#endif
\ No newline at end of file
+#endif