41 #include <Bpp/Text/TextTools.h> 42 #include <Bpp/Io/FileTools.h> 49 string line = TextTools::removeSurroundingWhiteSpaces(FileTools::getNextLine(input));
51 unsigned int countOpen = 0;
52 unsigned int countClosed = 0;
59 if (line[line.size() - 1] ==
']')
64 line = TextTools::removeSurroundingWhiteSpaces(FileTools::getNextLine(input));
65 if(countOpen == countClosed)
76 if (! input) {
throw IOException (
"NexusTools::getNextCommand(). Failed to read from stream"); }
78 string line = TextTools::removeSurroundingWhiteSpaces(getNextNonCommentLine(input));
79 if (TextTools::startsWith(line,
"BEGIN"))
85 bool commandComplete = TextTools::endsWith(line,
";");
87 line = line.substr(0, line.size() - 1);
89 string::size_type limit = line.find(
" ");
90 if (limit == string::npos)
102 name = line.substr(0, limit);
103 arguments = line.substr(limit + 1);
106 while(!commandComplete)
108 if (input.eof()) {
throw IOException (
"NexusTools::getNextCommand(). Reached end of file before the end of the command could be found"); }
109 line = TextTools::removeSurroundingWhiteSpaces(getNextNonCommentLine(input));
110 commandComplete = TextTools::endsWith(line,
";");
112 line = line.substr(0, line.size() - 1);
This alphabet is used to deal NumericAlphabet.