|
tufao
0.8.1
An asynchronous web framework for C++ built on top of Qt
|
This namespace provides utilities for dealing with query strings. More...
Functions | |
| TUFAO_EXPORT QByteArray | stringify (const QMap< QByteArray, QByteArray > &map, char sep= '&', char eq= '=', bool percentEncoding=true, char percent= '%') |
| Serialize an object to a query string. More... | |
| TUFAO_EXPORT QMap< QByteArray, QByteArray > | parse (const QByteArray &string, char sep= '&', char eq= '=', bool percentEncoding=true, char percent= '%') |
| Deserialize a query string to an object. More... | |
This namespace provides utilities for dealing with query strings.
| TUFAO_EXPORT QMap<QByteArray, QByteArray> Tufao::QueryString::parse | ( | const QByteArray & | string, |
| char | sep = '&', |
||
| char | eq = '=', |
||
| bool | percentEncoding = true, |
||
| char | percent = '%' |
||
| ) |
Deserialize a query string to an object.
If you enable percentEncoding, then the implementation will follow the application/x-www-form-urlencoded spec.
| string | The string to parse. |
| sep | The separator character. |
| eq | The assignment character. |
| percentEncoding | true if the function should escape the characters. You should set it to false if you know there is no percent encoding applied and need some performance improvement. |
| percent | It allows you to replace the percent sign character for another. |
| TUFAO_EXPORT QByteArray Tufao::QueryString::stringify | ( | const QMap< QByteArray, QByteArray > & | map, |
| char | sep = '&', |
||
| char | eq = '=', |
||
| bool | percentEncoding = true, |
||
| char | percent = '%' |
||
| ) |
Serialize an object to a query string.
If you enable percentEncoding, then the implementation will follow the application/x-www-form-urlencoded spec.
| map | The object to be serialized. |
| sep | The separator character. |
| eq | The assignment character. |
| percentEncoding | true if the function should escape the characters. You should set it to false if you know there is no percent encoding applied and need some performance improvement. |
| percent | It allows you to replace the percent sign character for another. |