Prusa Slicer 2.6.0
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
1800 {
1801 Iterator it = first;
1802 // Let the UTF-8 parser throw if it encounters an invalid UTF-8 sequence.
1803 if (! utf8_char_parser::parse(it, last, context, skipper, attr))
1804 return false;
1805 char c = *first;
1806 if (it - first > 1 || c < 0)
1807 MyContext::throw_exception("Non-ASCII7 characters are only allowed inside text blocks and string literals, not inside code blocks.", IteratorRange(first, it));
1808 if (c == '\r' || c == '\n' || c == '\t' || c == ' ') {
1809 // Skip the whitespaces
1810 ++ first;
1811 return true;
1812 } else
1813 // Stop skipping, let this 7bit ASCII character be processed.
1814 return false;
1815 }
ascii_char_skipper_parser skipper
Definition PlaceholderParser.cpp:1911
std::string::const_iterator Iterator
Definition PlaceholderParser.cpp:171
boost::iterator_range< Iterator > IteratorRange
Definition PlaceholderParser.cpp:172
static void throw_exception(const std::string &msg, const IteratorRange &it_range)
Definition PlaceholderParser.cpp:1558
bool parse(Iterator &first, Iterator const &last, Context &context, Skipper const &skipper, Attribute &attr) const
Definition PlaceholderParser.cpp:1743

References 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
1820 {
1821 return spirit::info("ASCII7_char");
1822 }

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