Azure IoT / azure_c_shared_utility

Dependents:   STM32F746_iothub_client_sample_mqtt f767zi_mqtt iothub_client_sample_amqp iothub_client_sample_http ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers urlencode.h Source File

urlencode.h

00001 // Copyright (c) Microsoft. All rights reserved.
00002 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
00003 
00004 #ifndef URLENCODE_H
00005 #define URLENCODE_H
00006 
00007 #include "azure_c_shared_utility/strings.h"
00008 
00009 #include "azure_c_shared_utility/umock_c_prod.h"
00010 
00011 #ifdef __cplusplus
00012 extern "C" {
00013 #endif
00014 
00015     /* @brief   URL Encode (aka percent encode) a string.
00016     * Please note that while the URL encoder accepts the full range of 8-bit extended ASCII,
00017     * it has unpredictable behavior beyond the 7-bit ASCII standard. This function does NOT
00018     * guarantee correctness of output for characters outside this range.
00019     *
00020     * @param    URL Encode can be done on a const char* or a STRING_HANDLE, use the appropriate
00021     * function depending on input type, they both behave the same way.
00022     *
00023     * @return   Returns a STRING_HANDLE with the encoded string, or NULL on failure.
00024     */
00025     MOCKABLE_FUNCTION(, STRING_HANDLE, URL_Encode, STRING_HANDLE, input);
00026     MOCKABLE_FUNCTION(, STRING_HANDLE, URL_EncodeString, const char*, textEncode);
00027 
00028     /* @brief   URL Decode (aka percent decode) a string.
00029     * Please note that the URL decoder only supports decoding characters that fall within the
00030     * 7-bit ASCII range. It does NOT support 8-bit extended ASCII, and will fail if you try.
00031     *
00032     * @param    URL Decode can be done on a const char* or a STRING_HANDLE, use the appropriate
00033     * function depending on input type, they both behave the same way.
00034     *
00035     * @return   Returns a STRING_HANDLE with the decoded string, or NULL on failure.
00036     */
00037     MOCKABLE_FUNCTION(, STRING_HANDLE, URL_Decode, STRING_HANDLE, input);
00038     MOCKABLE_FUNCTION(, STRING_HANDLE, URL_DecodeString, const char*, textDecode);
00039 
00040 #ifdef __cplusplus
00041 }
00042 #endif
00043 
00044 #endif /* URLENCODE_H */
00045