|
Functions | |
| Q_ENTRY * | qDecodeQueryString (Q_ENTRY *entry, const char *query, char equalchar, char sepchar, int *count) |
| Parse URL encoded query string. | |
| char * | qEncodeUrl (const char *str) |
| Encode string as URL encoded string. | |
| char * | qDecodeUrl (char *str) |
| Parse URL encoded string. | |
| Q_ENTRY* qDecodeQueryString | ( | Q_ENTRY * | entry, | |
| const char * | query, | |||
| char | equalchar, | |||
| char | sepchar, | |||
| int * | count | |||
| ) |
Parse URL encoded query string.
| entry | a pointer of Q_ENTRY structure. NULL can be used | |
| query | URL encoded string | |
| equalchar | separater of key, value pair | |
| sepchar | separater of line | |
| count | if count is not NULL, a number of parsed entries are stored |
cont char query = "category=love&str=%C5%A5%B5%F0%C4%DA%B4%F5&sort=asc"; Q_ENTRY entries = qDecodeQueryString(NULL, req->pszQueryString, '=', '&', NULL); printf("category = %s\n", qEntryGetStr(entries, "category")); printf("str = %s\n", qEntryGetStr(entries, "str")); printf("sort = %s\n", qEntryGetStr(entries, "sort")); qEntryFree(entries);
| char* qEncodeUrl | ( | const char * | str | ) |
Encode string as URL encoded string.
| str | a pointer of source string |
char encstr = qEncodeUrl("hello 'qDecoder' world"); if(encstr != NULL) free(encstr);
| char* qDecodeUrl | ( | char * | str | ) |
Parse URL encoded string.
| str | a pointer of URL encoded string |
char str[256] = "hello%20%27qDecoder%27%20world"; printf("Before : %s\n", str); qDecodeUrl(str); printf("After : %s\n", str);
| [Home] [About] [Examples] [Changes] [Download] [SVN Repository] [Install] [Reference] |