-3

Is there a light-weight library for this?

I'm use node.js to parse url log file, but I found it's slow by it's default module querystring and tj's qs.

So I wonder if there is a C++ library to parse the url (better to json string directly) and it's light-weight enough to compile to a node C++ addon.

qs.parse('/?0=foo')
qs.parse('/?a[>=]=23')
qs.parse('/?foo=bar&baz')
qs.parse('/?a[b][c]=d')
qs.parse('/?a[b][c][d]=e')
qs.parse('/?a=b&a=c')
qs.parse('/?a[]=b')
qs.parse('/?a[]=b&a[]=c&a[]=d')
qs.parse('/?a=b&a[]=c')
qs.parse('/?a[]=b&a=c')
qs.parse('/?a=b&a[0]=c')
qs.parse('/?a=b&a[1]=c')
qs.parse('/?a[b][]=c&a[b][]=d')
qs.parse('/?a[1]=c&a[0]=b&a[2]=d')
qs.parse('/?a[1]=c&a[0]=b')
qs.parse('/?a[20]=a')
qs.parse('/?a[12b]=c')
qs.parse('/?he%3Dllo=th%3Dere')
qs.parse('/?a[b]=c%20d')
qs.parse('/?foo[0]=bar&foo[bad]=baz')
qs.parse('/?foo[bad]=baz&foo[0]=bar')
qs.parse('/?foo[]=bar&foo[bad]=baz')
qs.parse('/?foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb')
qs.parse('/?a[]=b&a[t]=u&a[hasOwnProperty]=c')
qs.parse('/?foo[0].baz=bar&fool.bad=baz')
// ...

well, can you feel my problem?

7

1 Answer 1

3

You can use cpp-netlib library and in particular the URI class (boost::network::http::uri). More information here.

Sign up to request clarification or add additional context in comments.

1 Comment

Francesco, Thanks a lot~

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.