|
Zip and Skip Tries
|
Implementation of nucleotide utility functions. More...

Go to the source code of this file.
Functions | |
| bool | is_valid_nucleotide (char nucleotide) |
| Checks if a character represents a valid nucleotide. | |
| std::ostream & | operator<< (std::ostream &os, const Nucleotide &nucleotide) |
| Inserts a textual representation of a nucleotide into an output stream. | |
Implementation of nucleotide utility functions.
This file implements the functions declared in nucleotide.hpp for nucleotide validation and stream output operations. It provides efficient implementations for handling nucleotide conversions and validation.
Definition in file nucleotide.cpp.
Checks if a character represents a valid nucleotide.
Determines whether the provided character is a valid nucleotide representation (A, C, G, T in either uppercase or lowercase).
| nucleotide | The character to check. |
Definition at line 14 of file nucleotide.cpp.
| std::ostream & operator<< | ( | std::ostream & | os, |
| const Nucleotide & | nucleotide | ||
| ) |
Inserts a textual representation of a nucleotide into an output stream.
Converts the Nucleotide enum value to its character representation and inserts it into the provided output stream. Uses a switch statement to handle each nucleotide type explicitly and throws an std::invalid_argument exception for Nucleotide::INVALID rather than silently outputting a placeholder. This allows Nucleotide objects to be used directly with stream operators.
| os | The output stream to insert into. |
| nucleotide | The nucleotide to insert. |
| std::invalid_argument | if nucleotide is Nucleotide::INVALID. |
Definition at line 21 of file nucleotide.cpp.