42 #include "../TreeTemplate.h"
43 #include "../TreeTemplateTools.h"
63 return string(
"New hampshire parenthesis format. ") +
64 "See http://evolution.genetics.washington.edu/phylip/newicktree.html for more info.";
69 #if defined(NO_VIRTUAL_COV)
77 if (! in) {
throw IOException (
"Newick::read: failed to read from stream"); }
80 string temp, description;
82 while (getline(in, temp,
'\n'))
84 string::size_type index = temp.find(
";");
85 if(index != string::npos)
87 description += temp.substr(0, index + 1);
90 else description += temp;
95 throw IOException(
"Newick::read: no tree was found!");
104 if (! out) {
throw IOException (
"Newick::writeTree: failed to write to stream"); }
121 if (! out) {
throw IOException (
"Newick::writeTree: failed to write to stream"); }
137 if (! in) {
throw IOException (
"Newick::read: failed to read from stream"); }
140 string temp, description;
141 string::size_type index;
143 while (getline(in, temp,
'\n'))
145 index = temp.find(
";");
146 if (index != string::npos)
148 description += temp.substr(0, index + 1);
151 description = temp.substr(index + 1);
153 else description += temp;
163 if (! out) {
throw IOException (
"Newick::write: failed to write to stream"); }
164 for(
unsigned int i = 0; i < trees.size(); i++)
183 if (! out) {
throw IOException (
"Newick::write: failed to write to stream"); }
184 for(
unsigned int i = 0; i < trees.size(); i++)