-string Tree::readLabel(ifstream& filehandle) {
- try {
-
- string label = "";
-
- //to pass over labels in trees
- int c=filehandle.get();
- while((c!=',') && (c != -1) && (c!= ':') && (c!=';')){ label += c; c=filehandle.get(); }
- filehandle.putback(c);
-
- return label;
-
- }
- catch(exception& e) {
- m->errorOut(e, "Tree", "readLabel");
- exit(1);
- }
-}
-/*******************************************************/
-string Tree::readName(ifstream& filehandle) {
- try {
-
- string name = "";
- int c = filehandle.get();
-
- while ((c != '(') && (c != ')') && (c != ',') && (c != ':') && (c != '\n') && (c != 32) && (c != '\t')) {
- name += c;
- c = filehandle.get();
- }
-
-//cout << "name = " << name << endl;
- filehandle.putback(c);
-
- return name;
-
- }
- catch(exception& e) {
- m->errorOut(e, "Tree", "readName");
- exit(1);
- }
-}
-/*******************************************************/
-string Tree::readBranchLength(ifstream& filehandle) {
- try {
-
- string br = "";
- int c;
- while ((c != '(') && (c != ')') && (c != ',') && (c != ';') && (c != '\n') && (c != '\t') && (c != 32)) {
- br += c;
- c = filehandle.get();
- }
- filehandle.putback(c);
-
- return br;
-
- }
- catch(exception& e) {
- m->errorOut(e, "Tree", "readBranchLength");
- exit(1);
- }
-}