[spirit] qi pheonix struct adaptation
Hello, Need a little guidance when it comes to adapting structs. Let's say I've got a simple struct: struct data_t { int a; int b; int c; }; When I adapt it, I need to specify the fields into which the values are being consumed and subsequently synthesized? What happens for optional consumers, in one use-case? In another use-case, what happens if one value or another value or a third value can be consumed for that field? So, something like this, pardoning the pseudo-code: using qi::int_; using qi::lit; qi::rule<Iterator, data_t()> rule_; //a is optional, followed by b is mandatory, followed by c can be 1 | 2 | 3 rule_ %= -( int_ ) >> lit(',') >> int_ >> lit('.') >> ( int_(1) | int_(2) | int_(3) ); This is applying into a GPS NMEA parser domain, so along these lines for things like geo-spacial-coordinates, latitude/longitude, time, etc. Thank you... Regards, Michael Powell
participants (1)
-
Michael Powell