...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::parser::quoted_string_parser
// In header: <boost/parser/parser.hpp> template<typename Quotes, typename Escapes> struct quoted_string_parser { // public member functions constexpr quoted_string_parser() return parser_interface(quoted_string_parser(std::move(x))); template<parsable_range_like R> constexpr auto operator()(R &&) const noexcept; template<typename T, typename U> auto operator()(T, symbols< U > const &) const noexcept; template<parsable_range_like R, typename T> auto operator()(R &&, symbols< T > const &) const noexcept; // public data members Quotes chs_; Escapes escapes_; char32_t ch_; };
Matches a string delimited by quotation marks; produces a std::string
attribute.
quoted_string_parser
public member functionsconstexpr quoted_string_parser() return parser_interface(quoted_string_parser(std::move(x)));
template<parsable_range_like R> constexpr auto operator()(R && r) const noexcept;
Returns a parser_interface
containing a quoted_string_parser
that accepts any of the values in r
as its quotation marks. If the input being matched during the parse is a a sequence of char32_t
, the elements of r
are transcoded from their presumed encoding to UTF-32 during the comparison. Otherwise, the character begin matched is directly compared to the elements of r
.
template<typename T, typename U> auto operator()(T x, symbols< U > const & escapes) const noexcept;
Returns a parser_interface
containing a quoted_string_parser
that uses x
as its quotation marks. symbols
provides a list of strings that may appear after a backslash to form an escape sequence, and what character(s) each escape sequence represents. Note that "\\"</tt> and <tt>"\ch"
are always valid escape sequences.
template<parsable_range_like R, typename T> auto operator()(R && r, symbols< T > const & escapes) const noexcept;
Returns a parser_interface
containing a quoted_string_parser
that accepts any of the values in r
as its quotation marks. If the input being matched during the parse is a a sequence of char32_t
, the elements of r
are transcoded from their presumed encoding to UTF-32 during the comparison. Otherwise, the character begin matched is directly compared to the elements of r
. symbols
provides a list of strings that may appear after a backslash to form an escape sequence, and what character(s) each escape sequence represents. Note that "\\"</tt> and <tt>"\ch"
are always valid escape sequences.