Opened 12 years ago

#4336 new Feature Requests

[spirit] A trait to access encoding-specific parsers

Reported by: Andrey Semashev Owned by: Hartmut Kaiser
Milestone: Boost 1.43.0 Component: spirit
Version: Boost 1.44.0 Severity: Not Applicable
Keywords: Cc:

Description

Originated from this discussion.

The attached patch allows to gain access to the encoding-specific parsers by specifying the encoding type to the encoding_specific template parameter. This allows the following use case:

  template< typename CharT >
  void parse(const CharT* str)
  {
    typedef typename my_traits< CharT >::encoding encoding;
    typedef spirit::encoding_specific< encoding > parsers;
    qi::parse(str, *parsers::char_);
  }

Attachments (2)

common_terminals.hpp.diff (3.4 KB ) - added by Andrey Semashev 12 years ago.
A patch for common_terminals.hpp adding the encoding_specific trait
encoding_specific_impl.hpp (11.5 KB ) - added by Andrey Semashev 12 years ago.
The implementation file to be placed in boost/spirit/home/support/detail

Download all attachments as: .zip

Change History (2)

by Andrey Semashev, 12 years ago

Attachment: common_terminals.hpp.diff added

A patch for common_terminals.hpp adding the encoding_specific trait

by Andrey Semashev, 12 years ago

Attachment: encoding_specific_impl.hpp added

The implementation file to be placed in boost/spirit/home/support/detail

Note: See TracTickets for help on using tickets.