(C++) IsNewick
January 7, 2018 · View on GitHub
(C++) IsNewick
IsNewick is a Newick code snippets to determine if a std::string is a well-formed Newick.
///IsNewick returns true if a std::string is a valid Newick ///and false otherwise. ///From http://www.richelbilderbeek.nl/CppIsNewick.htm bool IsNewick(const std::string& s) { try { CheckNewick(s); } catch (...) { return false; } return true; } ///IsNewick returns true if a std::vector<int> is a valid Newick ///and false otherwise. ///From http://www.richelbilderbeek.nl/CppIsNewick.htm bool IsNewick(const std::vector<int>& v) { try { CheckNewick(v); } catch (...) { return false; } return true; }