2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file FBaseUtilUrlDecoder.h
19 * @brief This is the header file for the %UrlDecoder class.
21 * This header file contains the declarations of the %UrlDecoder class.
23 #ifndef _FBASE_UTIL_URL_DECODER_H_
24 #define _FBASE_UTIL_URL_DECODER_H_
27 #include <FBaseString.h>
30 namespace Tizen { namespace Base { namespace Utility
34 * @brief This class provides a method for decoding strings using a specific encoding scheme.
38 * The %UrlDecoder class provides a method for decoding strings using a specific encoding scheme.
40 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/base/url_encoder_decoder.htm">UrlEncoder and UrlDecoder</a>.
42 * The following example demonstrates how to use the %UrlDecoder class.
47 * using namespace Tizen::Base;
48 * using namespace Tizen::Base::Utility;
51 * MyClass::UrlDecoderSample(void)
53 * result r = E_SUCCESS;
54 * String str1(L"url+encoding+test%3f");
57 * // Decodes the input string
58 * r = UrlDecoder::Decode(str1, L"UTF-8", str2);
63 class _OSP_EXPORT_ UrlDecoder
67 * Decodes an encoded string using a specific encoding scheme.
71 * @return An error code
72 * @param[in] str An instance of String to decode
73 * @param[in] encodingScheme The supported encoding scheme
74 * @param[out] decodedStr The decoded string
75 * @exception E_SUCCESS The method is successful.
76 * @exception E_INVALID_ARG A specified input parameter is invalid.
77 * @exception E_SYSTEM A system error has occurred.
78 * @exception E_UNSUPPORTED_TYPE The specified encoding scheme is not supported.
79 * @exception E_INVALID_ENCODING_RANGE The specified string contains code points that are outside the bounds of the character encoding scheme.
80 * @remarks This method is used for decoding. It decodes an application/x-www-form-urlencoded string using a
81 * specific encoding scheme. The supplied encoding scheme is used to determine what characters are represented
82 * by any consecutive sequences of the form "%ab", where ab is the two-digit hexadecimal representation of a
86 static result Decode(const Tizen::Base::String& str, const Tizen::Base::String& encodingScheme, Tizen::Base::String& decodedStr);
90 * This default constructor is intentionally declared as private so that only the platform can create an instance.
95 * This destructor is intentionally declared as private so that only the platform can delete an instance.
97 virtual ~UrlDecoder(void);
100 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
102 * @param[in] rhs The instance of the UrlDecoder
104 UrlDecoder(const UrlDecoder& rhs);
107 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
109 * @param[in] rhs An instance of %UrlDecoder
111 UrlDecoder& operator =(const UrlDecoder& rhs);
114 }}} // Tizen::Base::Utility
115 #endif // _FBASE_UTIL_URL_DECODER_H_