bpp-seq3  3.0.0
bpp::NexusTools Class Reference

Tools for parsing Nexus files. More...

#include <Bpp/Seq/Io/NexusTools.h>

Static Public Member Functions

static std::string getNextNonCommentLine (std::istream &input)
 
static bool getNextCommand (std::istream &input, std::string &name, std::string &arguments, bool lineBrk=true)
 parse the next command name within a block. More...
 

Detailed Description

Tools for parsing Nexus files.

The Nexus format is described in the following paper: Maddison D, Swofford D, and Maddison W (1997), Syst Biol 46(4):590-621

Author
Julien Dutheil

Definition at line 23 of file NexusTools.h.

Member Function Documentation

◆ getNextCommand()

bool NexusTools::getNextCommand ( std::istream &  input,
std::string &  name,
std::string &  arguments,
bool  lineBrk = true 
)
static

parse the next command name within a block.

Parameters
input[in] The input stream.
name[out] Will contain the name of the command.
arguments[out] Will contain the arguments of the commands, as raw data. The arguments will not be parsed.
lineBrk[in] Tell is the line break should be preserved in the arguments.
Returns
Whether a command was found in the current block.
Exceptions
IOExceptionIn case of bad format.

Definition at line 38 of file NexusTools.cpp.

References bpp::TextTools::endsWith(), bpp::TextTools::removeSurroundingWhiteSpaces(), and bpp::TextTools::startsWith().

Referenced by bpp::NexusIOSequence::appendAlignmentFromStream().

◆ getNextNonCommentLine()

std::string NexusTools::getNextNonCommentLine ( std::istream &  input)
static
Parameters
inputThe input stream.
Returns
A string containing the next line in the file wichi is not empty and is no a comment line.

Definition at line 13 of file NexusTools.cpp.

References bpp::FileTools::getNextLine(), and bpp::TextTools::removeSurroundingWhiteSpaces().


The documentation for this class was generated from the following files: