Quetzal-CoaTL
The Coalescence Template Library
Loading...
Searching...
No Matches
quetzal::format Namespace Reference

Parsers and generators for input/output. More...

Namespaces

namespace  genetics
 Data-structures for genetic datasets.
 
namespace  newick
 Generic components for parsing or generating Newick strings.
 

Classes

struct  identity
 Do not change anything. More...
 
struct  is_balanced
 Class template. More...
 
struct  is_balanced< parenthesis >
 Specialization for parenthesis. More...
 
struct  is_balanced< square_bracket >
 Specialization for square bracket. More...
 
struct  parenthesis
 Tag. More...
 
struct  square_bracket
 Tag. More...
 

Functions

bool check_if_balanced (const std::string &input, const char &open='(', const char &close=')')
 Check if the string is balanced for open/close symbols (parenthesis,brackets)
 

Detailed Description

Parsers and generators for input/output.

Function Documentation

◆ check_if_balanced()

bool quetzal::format::check_if_balanced ( const std::string &  input,
const char &  open = '(',
const char &  close = ')' 
)

Check if the string is balanced for open/close symbols (parenthesis,brackets)

Note
Since parenthesis checking is a context-free grammar, it requires a stack. Regex can not accomplish that since they do not have memory.