|
A library for working with phylogenetic and population genetic data.
v0.27.0
|
|
Go to the documentation of this file.
55 bool found_digits =
false;
58 if( source && ( *source ==
'+' || *source ==
'-' )) {
71 if( source && *source ==
'.' ) {
85 if( ! found_digits ) {
98 if( source && ( *source ==
'+' || *source ==
'-' )) {
119 bool use_twin_quotes,
123 std::string value =
"";
131 char qmark = *source;
135 if( include_qmarks ) {
139 bool found_closing_qmark =
false;
143 if( *source == qmark ) {
147 if( ! use_twin_quotes ) {
148 found_closing_qmark =
true;
154 if( source && *source == qmark ) {
157 found_closing_qmark =
true;
162 }
else if( *source ==
'\\' && use_escapes ) {
169 throw std::runtime_error(
170 "Unexpected end of " + source.
source_name() +
" at " + source.
at()
171 +
". Expecting escape sequence."
191 if( ! found_closing_qmark ) {
193 throw std::runtime_error(
194 "Unexpected end of " + source.
source_name() +
" at " + source.
at()
195 +
". Expected closing quotation mark."
200 if( include_qmarks ) {
std::string deescape(std::string const &text)
Return a string where backslash-escaped characters are transformed into their respective string form.
constexpr bool char_match_ci(char c1, char c2) noexcept
Return whether two chars are the same, case insensitive, and ASCII-only.
Provides some commonly used string utility functions.
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
constexpr bool is_digit(char c) noexcept
Return whether a char is a digit (0-9), ASCII-only.
std::string parse_quoted_string(utils::InputStream &source, bool use_escapes, bool use_twin_quotes, bool include_qmarks)
Read a string in quotation marks from a stream and return it.
std::string parse_number_string(utils::InputStream &source)
Read a general number string from an input stream.