OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::client::ascii_char_skipper_parser Struct Reference
Inheritance diagram for Slic3r::client::ascii_char_skipper_parser:
Collaboration diagram for Slic3r::client::ascii_char_skipper_parser:

Public Member Functions

template<typename Iterator, typename Context, typename Skipper, typename Attribute>
bool parse (Iterator &first, Iterator const &last, Context &context, Skipper const &skipper, Attribute &attr) const
template<typename Context>
spirit::info what (Context &) const

Detailed Description

Member Function Documentation

◆ parse()

template<typename Iterator, typename Context, typename Skipper, typename Attribute>
bool Slic3r::client::ascii_char_skipper_parser::parse ( Iterator & first,
Iterator const & last,
Context & context,
Skipper const & skipper,
Attribute & attr ) const
inline
2126 {
2127 Iterator it = first;
2128 // Let the UTF-8 parser throw if it encounters an invalid UTF-8 sequence.
2129 if (! utf8_char_parser::parse(it, last, context, skipper, attr))
2130 return false;
2131 char c = *first;
2132 if (it - first > 1 || c < 0)
2133 MyContext::throw_exception(L("Non-ASCII7 characters are only allowed inside text blocks and string literals, not inside code blocks."), IteratorRange(first, it));
2134 if (c == '\r' || c == '\n' || c == '\t' || c == ' ') {
2135 // Skip the whitespaces
2136 ++ first;
2137 return true;
2138 } else
2139 // Stop skipping, let this 7bit ASCII character be processed.
2140 return false;
2141 }
#define L(s)
Definition ExtrusionEntity.cpp:25
ascii_char_skipper_parser skipper
Definition PlaceholderParser.cpp:2241
std::string::const_iterator Iterator
Definition PlaceholderParser.cpp:221
boost::iterator_range< Iterator > IteratorRange
Definition PlaceholderParser.cpp:222
static void throw_exception(const std::string &msg, const IteratorRange &it_range)
Definition PlaceholderParser.cpp:1882
bool parse(Iterator &first, Iterator const &last, Context &context, Skipper const &skipper, Attribute &attr) const
Definition PlaceholderParser.cpp:2069

References L, Slic3r::client::utf8_char_parser::parse(), and Slic3r::client::MyContext::throw_exception().

Here is the call graph for this function:

◆ what()

template<typename Context>
spirit::info Slic3r::client::ascii_char_skipper_parser::what ( Context & ) const
inline
2146 {
2147 return spirit::info("ASCII7_char");
2148 }

The documentation for this struct was generated from the following file: