Parsing a List of Key-Value Pairs Using Spirit.Qi

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Parsing a List of Key-Value Pairs Using Spirit.Qi

huvcbo
This post has NOT been accepted by the mailing list yet.
Hello, im using the code from Hartmut Kaiser Parsing a List of Key-Value Pairs Using Spirit.Qi

in my case the input is
trtyp=spdh&siteid=123457&mname=0001001&ipadr=127.0.0.1&pedid=11111&pedtyp=ALFA128&shopcity=Vålby Åby Alléns Livs&trans=9.4800099999        31    141112105002FF00050000\034B00001595\034D0\034FL21453  \034G20899936\034P3\034a\036A0147\036B-00002275301\036C0147\036D+00002275301\036E0000171\036F0000000\036G1\036H0\036I001\034d9229295     \034e00\034h0010013790\034\066\036E051\036I752\036TFFFF7399930E8500c165\036X000000\034\071\036A1\036C45\036D000002610200\036I5499\036PE0F0C8\036Q700080B001\036R00059\036SCHRISTER, ONE 0984     CITY STHLM   171 78    SE

query =  pair >> *((qi::lit(';') | '&') >> pair);
pair  =  key >> -('=' >> value);
key   =  qi::char_("a-zA-Z_") >> *qi::char_("a-zA-Z_0-9");
value = +qi::char_("a-zA-Z_0-9");
do not work
 
try to change to
value = +qi::char_;
but this do not work,
so how can i fix thie
appreciates any help.