2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FBaseUtilUrlDecoder.h
20 * @brief This is the header file for the %UrlDecoder class.
22 * This header file contains the declarations of the %UrlDecoder class.
24 #ifndef _FBASE_UTIL_URL_DECODER_H_
25 #define _FBASE_UTIL_URL_DECODER_H_
28 #include <FBaseString.h>
31 namespace Tizen { namespace Base { namespace Utility
35 * @brief This class provides a method for decoding strings using a specific encoding scheme.
39 * The %UrlDecoder class provides a method for decoding strings using a specific encoding scheme.
41 * 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>.
43 * The following example demonstrates how to use the %UrlDecoder class.
48 * using namespace Tizen::Base;
49 * using namespace Tizen::Base::Utility;
52 * MyClass::UrlDecoderSample(void)
54 * result r = E_SUCCESS;
55 * String str1(L"url+encoding+test%3f");
58 * // Decodes the input string
59 * r = UrlDecoder::Decode(str1, L"UTF-8", str2);
64 class _OSP_EXPORT_ UrlDecoder
68 * Decodes an encoded string using a specific encoding scheme.
72 * @return An error code
73 * @param[in] str An instance of String to decode
74 * @param[in] encodingScheme The supported encoding scheme
75 * @param[out] decodedStr The decoded string
76 * @exception E_SUCCESS The method is successful.
77 * @exception E_INVALID_ARG A specified input parameter is invalid.
78 * @exception E_SYSTEM A system error has occurred.
79 * @exception E_UNSUPPORTED_TYPE The specified encoding scheme is not supported.
80 * @exception E_INVALID_ENCODING_RANGE The specified string contains code points that are outside the bounds of the character encoding scheme.
81 * @remarks This method is used for decoding. It decodes an application/x-www-form-urlencoded string using a
82 * specific encoding scheme. The supplied encoding scheme is used to determine what characters are represented
83 * by any consecutive sequences of the form "%ab", where ab is the two-digit hexadecimal representation of a
87 static result Decode(const Tizen::Base::String& str, const Tizen::Base::String& encodingScheme, Tizen::Base::String& decodedStr);
91 * This default constructor is intentionally declared as private so that only the platform can create an instance.
96 * This destructor is intentionally declared as private so that only the platform can delete an instance.
98 virtual ~UrlDecoder(void);
101 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
103 * @param[in] rhs The instance of the UrlDecoder
105 UrlDecoder(const UrlDecoder& rhs);
108 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
110 * @param[in] rhs An instance of %UrlDecoder
112 UrlDecoder& operator =(const UrlDecoder& rhs);
115 }}} // Tizen::Base::Utility
116 #endif // _FBASE_UTIL_URL_DECODER_H_