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 FBaseUtilUri.h
19 * @brief This is the header file for the %Uri class.
21 * This header file contains the declarations of the %Uri class.
23 #ifndef _FBASE_UTIL_URI_H_
24 #define _FBASE_UTIL_URI_H_
26 #include <FBaseObject.h>
27 #include <FBaseString.h>
28 #include <FBaseBuffer.h>
31 namespace Tizen { namespace Base { namespace Utility
36 * @brief This class provides useful methods for URI.
40 * The %Uri class represents a Uniform Resource Identifier (URI) as defined by RFC2396 and provides accessors
41 * which access the URI component.
42 * It also provides methods for creating, accessing, normalizing, resolving, and relativizing %Uri instances.
44 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/base/uri.htm">URI</a>.
46 * The following example demonstrates how to use the %Uri class.
52 * using namespace Tizen::Base;
53 * using namespace Tizen::Base::Utility;
56 * MyClass::UriSample(void)
58 * String base(L"http://www.samsung.com");
59 * String against(L"/osp/framework/index.html");
60 * String resolveString(L"http://www.samsung.com/osp/framework/index.html");
63 * baseUri.SetUri(base);
66 * againstUri.SetUri(against);
69 * baseUri.Resolve(againstUri, resultUri);
71 * String resultString = resultUri.ToString();
72 * if (resultString.Equals(resolveString))
80 class _OSP_EXPORT_ Uri
81 : public Tizen::Base::Object
85 * This is the default constructor for this class.
92 * Copying of objects using this copy constructor is allowed.
96 * @param[in] uri An instance of %Uri to copy
101 * This destructor overrides Tizen::Base::Object::~Object().
108 * Sets the current %Uri instance to the value of the specified instance of %Uri.
112 * @param[in] uri An instance of %Uri
114 void SetUri(const Uri& uri);
117 * Sets the current %Uri instance by parsing a given string.
121 * @return An error code
122 * @param[in] str A string to parse into a URI
123 * @exception E_SUCCESS The method is successful.
124 * @exception E_INVALID_ARG The specified @c str is an empty string.
125 * @exception E_INVALID_FORMAT The specified @c str violates the URI syntax (RFC 2396).
127 result SetUri(const Tizen::Base::String& str);
130 * Sets an absolute %Uri instance with given components.
134 * @return An error code
135 * @param[in] scheme The scheme
136 * @param[in] ssp The scheme-specific-part
137 * @param[in] fragment The fragment
138 * @exception E_SUCCESS The method is successful.
139 * @exception E_INVALID_FORMAT A component violates the URI syntax(RFC 2396).
141 result SetUri(const Tizen::Base::String& scheme, const Tizen::Base::String& ssp, const Tizen::Base::String& fragment);
144 * Sets an absolute and hierarchical %Uri instance with the given components.
148 * @return An error code
149 * @param[in] scheme The scheme
150 * @param[in] userInfo The user name and authorization
151 * @param[in] host The host name
152 * @param[in] port The port number
153 * @param[in] path The path
154 * @param[in] query The query
155 * @param[in] fragment The fragment
156 * @exception E_SUCCESS The method is successful.
157 * @exception E_INVALID_FORMAT A component violates the URI syntax(RFC 2396).
159 result SetUri(const Tizen::Base::String& scheme, const Tizen::Base::String& userInfo, const Tizen::Base::String& host, int port, const Tizen::Base::String& path, const Tizen::Base::String& query, const Tizen::Base::String& fragment);
162 * Sets an absolute and hierarchical %Uri instance with the given components.
166 * @return An error code
167 * @param[in] scheme The scheme
168 * @param[in] host The host name
169 * @param[in] path The path
170 * @param[in] fragment The fragment
171 * @exception E_SUCCESS The method is successful.
172 * @exception E_INVALID_FORMAT A component violates the URI syntax(RFC 2396).
173 * @remarks The authority and query component are left empty, and the port is set to @c -1.
175 result SetUri(const Tizen::Base::String& scheme, const Tizen::Base::String& host, const Tizen::Base::String& path, const Tizen::Base::String& fragment);
178 * Sets an absolute and hierarchical %Uri instance with the given components.
182 * @return An error code
183 * @param[in] scheme The scheme
184 * @param[in] authority The authority
185 * @param[in] path The path
186 * @param[in] query The query
187 * @param[in] fragment The fragment
188 * @exception E_SUCCESS The method is successful.
189 * @exception E_INVALID_FORMAT A component violates the URI syntax(RFC 2396).
191 result SetUri(const Tizen::Base::String& scheme, const Tizen::Base::String& authority, const Tizen::Base::String& path, const Tizen::Base::String& query, const Tizen::Base::String& fragment);
194 * Copying of objects using this copy assignment operator is allowed.
198 * @return A reference to the calling instance
199 * @param[in] rhs An instance of %Uri
201 Uri& operator =(const Uri& rhs);
204 * Gets the value of the authority component.
208 * @return The value of the authority component, @n
209 * else an empty string if the authority component is undefined
210 * @remarks The string returned by this method is equal to the string returned by GetEncodedAuthority(),
211 * except that all sequences of the escaped octets are decoded.
213 Tizen::Base::String GetAuthority(void) const;
216 * Gets the value of the fragment component.
220 * @return The value of the fragment component, @n
221 * else an empty string if the fragment component is undefined
222 * @remarks The string returned by this method is equal to the string returned by GetEncodedFragment(),
223 * except that all sequences of the escaped octets are decoded.
225 Tizen::Base::String GetFragment(void) const;
228 * Gets the value of the host component.
232 * @return The value of the host component, @n
233 * else an empty string if the host component is undefined
235 Tizen::Base::String GetHost(void) const;
238 * Gets the value of the path component.
242 * @return The value of the path component, @n
243 * else an empty string if the path component is undefined
244 * @remarks The string returned by this method is equal to the string returned by GetEncodedPath(),
245 * except that all sequences of the escaped octets are decoded.
247 Tizen::Base::String GetPath(void) const;
251 * Gets the value of the port component.
255 * @return The value of the port component, @n
256 * else @c -1 if the port component is undefined
258 int GetPort(void) const;
262 * Gets the value of the query component.
266 * @return The value of the query component, @n
267 * else an empty string if the query component is undefined
268 * @remarks The string returned by this method is equal to the string returned by GetEncodedQuery(),
269 * except that all sequences of the escaped octets are decoded.
271 Tizen::Base::String GetQuery(void) const;
275 * Gets the value of the scheme component.
279 * @return The value of the query scheme, @n
280 * else an empty string if the query scheme is undefined
282 Tizen::Base::String GetScheme(void) const;
286 * Gets the value of the scheme-specific-part component.
290 * @return The value of the scheme-specific-part component, @n
291 * else an empty string if the scheme-specific-part component is undefined
292 * @remarks The string returned by this method is equal to the string returned by GetEncodedSchemeSpecificPart(),
293 * except that all sequences of the escaped octets are decoded.
295 Tizen::Base::String GetSchemeSpecificPart(void) const;
299 * Gets the value of the user-info component.
303 * @return The value of the user-info component, @n
304 * else an empty string if the user-info component is undefined
305 * @remarks The string returned by this method is equal to the string returned by GetEncodedUserInfo(),
306 * except that all sequences of the escaped octets are decoded.
308 Tizen::Base::String GetUserInfo(void) const;
312 * Gets the encoded value of the authority component. @n
313 * The non-US-ASCII characters in the authority component are encoded to escaped octets.
317 * @return The encoded value of the authority component, @n
318 * else an empty string if the authority component is undefined
320 Tizen::Base::String GetEncodedAuthority(void) const;
324 * Gets the encoded value of the fragment component. @n
325 * The non-US-ASCII characters in the fragment component are encoded to escaped octets.
329 * @return The encoded value of the fragment component, @n
330 * else an empty string if the fragment component is undefined
332 Tizen::Base::String GetEncodedFragment(void) const;
336 * Gets the encoded value of the path component. @n
337 * The non-US-ASCII characters in the path component are encoded to escaped octets.
341 * @return The encoded value of the path component, @n
342 * else an empty string if the path component is undefined
344 Tizen::Base::String GetEncodedPath(void) const;
348 * Gets the encoded value of the query component. @n
349 * The non-US-ASCII characters in the query component are encoded to escaped octets.
353 * @return The encoded value of the query component, @n
354 * else an empty string if the query component is undefined
356 Tizen::Base::String GetEncodedQuery(void) const;
360 * Gets the encoded value of the scheme-specific-part component. @n
361 * The non-US-ASCII characters in the scheme-specific-part component are encoded to escaped octets.
365 * @return The encoded value of the scheme-specific-part component, @n
366 * else an empty string if the scheme-specific-part component is undefined
368 Tizen::Base::String GetEncodedSchemeSpecificPart(void) const;
371 * Gets the encoded value of a user-info component,
372 * or returns an empty string if the user-info component is undefined. @n
373 * The non-US-ASCII characters in the user-info component are encoded to escaped octets.
377 * @return The encoded value of user-info, @n
378 * else an empty string if the user-info component is undefined
380 Tizen::Base::String GetEncodedUserInfo(void) const;
384 * Checks whether the current %Uri instance is an absolute URI.
388 * @return @c true if the current %Uri instance is an absolute URI, @n
391 bool IsAbsolute(void) const;
395 * Checks whether the calling %Uri instance is an opaque URI.
399 * @return @c true if the current %Uri instance is an opaque URI, @n
402 bool IsOpaque(void) const;
406 * Gets the encoded US-ASCII string.
410 * @return The encoded US-ASCII string
411 * @remarks If this URI does not contain any non US_ASCII characters,
412 * then the string returned by this method is equal to the string returned by ToString().
414 * The following example demonstrates how to use the %GetEncodedString() method.
417 * String str(L"http://www.sec.com/osp?currency==\u20ac");
422 * String encode = uri.GetEncodedString(); // encode == L"http://www.sec.com/osp?currency==%E2%82%AC"
426 Tizen::Base::String GetEncodedString(void) const;
429 * Compares the calling URI instance to the specified %Uri instance. @n
430 * When comparing corresponding components of two URIs, if one component in the current instance is undefined
431 * but the other is defined, then the current instance is considered to be less than the given object.
435 * @return The result of the comparison
437 * < 0 if the current instance is less than the given object
438 * = 0 if the current instance is equal to the given object
439 * > 0 if the current instance is greater than the given object
441 * @param[in] uri An instance of %Uri
446 * Two URIs are ordered according to the ordering of schemes, without regard to case.
447 * 2. Hierarchical URI vs. Opaque URI
448 * A hierarchical URI is less than an opaque URI if they have an identical scheme.
449 * 3. Scheme-specific-part
450 * If two opaque URIs have an identical scheme, they are ordered according to
451 * the scheme-specific-part, without regard to %case.
453 * If two opaque URIs have identical schemes and scheme-specific-parts, they are ordered according
454 * to the ordering of fragments, without regard to case.
456 * If two hierarchical URIs have identical schemes, they are ordered according to the authority,
457 * without regard to the case.
458 * 5-1. Server-based authority
459 * If two URIs are server-based, they are ordered according to their user-information,
460 * without regard to case.
461 * If the hosts are identical, then the URIs are ordered according to the ordering of ports.
463 * If two hierarchical URIs have identical schemas and authority components, they are ordered according to the
464 * ordering of paths, without regard to the case.
465 * If their paths are identical, their queries are compared. And if the queries are the same, then their fragments
469 int CompareTo(const Uri& uri) const;
473 * Compares the specified instance to the current instance.
477 * @return @c true if the two instances are equal, @n
479 * @param[in] obj The object to compare with the current instance
480 * @remarks Two equal instances must return the same hash value. The default
481 * implementation of this method returns @c true if two instances
482 * have the same address. @n
483 * The method can be overridden to support value equality. Furthermore, the Equals()
484 * method must return the same results as the equality operator.
486 virtual bool Equals(const Tizen::Base::Object& obj) const;
490 * Gets the hash value of the current instance.
494 * @return The hash value of the current instance
495 * @remarks Two equal instances must return the same hash value. For better performance,
496 * the used hash function must generate a random distribution for all inputs.
498 virtual int GetHashCode(void) const;
502 * Normalizes the current URI.
506 * @return The normalized URI, @n
507 * else the current URI in case any error occurs
508 * @remarks Normalization is the process of removing unnecessary "." and ".." segments from the path component of the
509 * hierarchical URI. All "." segments are removed and If a ".." segment is preceded by a non-".." segment,
510 * both of these segments are removed. If a URI is opaque, the normalization has no effect.
512 * The following example demonstrates how to use the %Normalize() method.
516 * uri1.SetUri(L"http://www.example.com/a/b/../c/./d.html");
518 * Uri uriNormalized = uri1.Normalize();
519 * String uriStr = uriNormalized.ToString(); // uriStr == L"http://www.example.com/a/c/d.html"
527 * Parses the server-based authority component, if defined.
531 * @return An error code
532 * @param[out] uri The parsed URI
533 * @exception E_SUCCESS The method is successful.
534 * @exception E_INVALID_FORMAT The authority component is defined but cannot be parsed as a server-based authority.
535 * @remarks This method is provided because the generic URI syntax cannot always distinguish a malformed server-based authority from a legitimate registry-based authority.
536 * For example, the authority component in the URI string "//foo:bar/" is not a legal
537 * server-based authority but it is legal as a registry-based authority.
539 result ParseAuthority(Uri& uri);
543 * Relativizes the specified %Uri instance against the calling %Uri instance.
547 * @return An error code
548 * @param[in] uri The %Uri to relativize against the calling %Uri
549 * @param[out] resultUri The relativized URI
550 * @exception E_SUCCESS The method is successful.
551 * @exception E_OUT_OF_MEMORY The memory is insufficient.
552 * @remarks Relativization is the opposite of Resolution. It is used
553 * to divide a URI into the base URI and the relative URI.
555 result Relativize(const Uri& uri, Uri& resultUri);
559 * Resolves the specified %Uri instance against the calling %Uri instance.
563 * @return An error code
564 * @param[in] uri The URI to resolve against this URI
565 * @param[out] resultUri The resolved URI
566 * @exception E_SUCCESS The method is successful.
567 * @exception E_OUT_OF_MEMORY The memory is insufficient.
568 * @remarks Resolution is the process of resolving a URI against another, base URI. For hierarchical URI,
569 * the path of the original is resolved against the path of the base URI and then normalized. @n
571 * For example, to resolve the URI "/osp/framework/index.html" against the base URI "http://www.samsung.com" ,
572 * the resultant URI is "http://www.samsung.com/osp/framework/index.html".
575 result Resolve(const Uri& uri, Uri& resultUri);
579 * Sets the authority component to the specified String instance.
583 * @return An error code
584 * @param[in] authority The authority
585 * @exception E_SUCCESS The method is successful.
586 * @exception E_INVALID_FORMAT The specified string is invalid.
588 result SetAuthority(const Tizen::Base::String& authority);
592 * Sets the fragment component to the specified String instance.
596 * @return An error code
597 * @param[in] fragment The new fragment
598 * @exception E_SUCCESS The method is successful.
599 * @exception E_INVALID_FORMAT The specified string is invalid.
601 result SetFragment(const Tizen::Base::String& fragment);
605 * Sets the host component to the specified String instance.
609 * @return An error code
610 * @param[in] host The new host
611 * @exception E_SUCCESS The method is successful.
612 * @exception E_INVALID_FORMAT The specified string is invalid.
614 result SetHost(const Tizen::Base::String& host);
618 * Sets the path component to the specified String instance.
622 * @return An error code
623 * @param[in] path The new path component
624 * @exception E_SUCCESS The method is successful.
625 * @exception E_INVALID_FORMAT The specified string is invalid.
627 result SetPath(const Tizen::Base::String& path);
631 * Sets the port component to a given integer.
635 * @return An error code
636 * @param[in] port The new port component
637 * @exception E_SUCCESS The method is successful.
638 * @exception E_INVALID_ARG The specified @c port is negative.
640 result SetPort(int port);
644 * Sets the query component to the specified String instance.
648 * @return An error code
649 * @param[in] query The new query string
650 * @exception E_SUCCESS The method is successful.
651 * @exception E_INVALID_FORMAT The specified string is invalid.
653 result SetQuery(const Tizen::Base::String& query);
657 * Sets the scheme component to the specified String instance.
661 * @return An error code
662 * @param[in] scheme The new scheme
663 * @exception E_SUCCESS The method is successful.
664 * @exception E_INVALID_FORMAT The specified string is invalid.
666 result SetScheme(const Tizen::Base::String& scheme);
670 * Sets the scheme-specific-part component to the specified String instance.
674 * @return An error code
675 * @param[in] ssp The new scheme-specific-part component
676 * @exception E_SUCCESS The method is successful.
677 * @exception E_INVALID_FORMAT The specified string is invalid.
679 result SetSchemeSpecificPart(const Tizen::Base::String& ssp);
683 * Sets the user-info component to the specified String instance.
687 * @return An error code
688 * @param[in] userInfo The new user-info string
689 * @exception E_SUCCESS The method is successful.
690 * @exception E_INVALID_FORMAT The specified string is invalid.
692 result SetUserInfo(const Tizen::Base::String& userInfo);
696 * Gets the content of the calling %Uri instance as a string containing escaped octets.
700 * @return The content of this URI as a string containing escaped octets
702 Tizen::Base::String ToString(void) const;
706 // Constructs an Uri instance with the given components.
707 // scheme, ssp(opaquePart), authority, user-info, host, port, path, query, fragment
709 result SetUri(const Tizen::Base::String& scheme, const Tizen::Base::String& opaque,
710 const Tizen::Base::String& authority, const Tizen::Base::String& userInfo,
711 const Tizen::Base::String& host, int port, const Tizen::Base::String& path,
712 const Tizen::Base::String& query, const Tizen::Base::String& fragment);
715 // Appends a given scheme-specific-part to a String.
717 result AppendSchemeSpecificPart(Tizen::Base::String& strbuf, const Tizen::Base::String& opaque,
718 const Tizen::Base::String& authority, const Tizen::Base::String& userInfo,
719 const Tizen::Base::String& host, int port, const Tizen::Base::String& path,
720 const Tizen::Base::String& query) const;
723 // Appends a given fragment to a String.
725 result AppendFragment(Tizen::Base::String& strbuf, const Tizen::Base::String& fragment) const;
728 // Appends a given authority component to a String.
730 result AppendAuthority(Tizen::Base::String& strbuf, const Tizen::Base::String& authority,
731 const Tizen::Base::String& userInfo, const Tizen::Base::String& host, int port) const;
734 // Parses a given URI string.
736 result ParseUri(const Tizen::Base::String& str);
739 // Copies a given URI.
741 result CopyUri(const Uri& uri);
744 // Encodes all components - authority, fragment, path, query, and ssp.
746 void EncodeAllComponent(void);
749 // Parses a hierarchical URI string.
750 // @return The start index of the fragment. If the operation fails, @c -1 is returned.
751 // @param[in] startSsp The start index of scheme-specific-part
752 // @param[in] lengthOfUri The length of the URI string
753 // @param[out] authority A parsed authority component
754 // @param[out] path A parsed path component
755 // @param[out] query A parsed query component
757 result ParseHierarchicalUri(const Tizen::Base::String& str, int startSsp, Tizen::Base::String& authority,
758 Tizen::Base::String& path, Tizen::Base::String& query, int& index);
762 // Parses a server_based authority component.
763 // server_based authority: [user-info@]<host>[:port]
765 result ParseAuthority(const Tizen::Base::String& str, int curIndex, Tizen::Base::String& newAuth,
766 Tizen::Base::String& userInfo, Tizen::Base::String& host, int& port);
768 void SetAndEncodeAuthority(const Tizen::Base::String& authority,
769 const Tizen::Base::String& path, const Tizen::Base::String& query);
772 // Parses a server_based authority component.
773 // Assigns user-info, host and port to their member variable.
775 result ParseServerAuthority(const Tizen::Base::String& str, Tizen::Base::String& user, Tizen::Base::String& host, int& port);
778 // Parses an IPv4 address.
780 result ParseIpv4(const Tizen::Base::String& str, int index, int& count);
783 // Parses an IPv6 address.
784 // It will be implemented.
786 result ParseIpv6(const Tizen::Base::String& ip6, Tizen::Base::String& outIpv6);
789 // Parses a host name and returns a host name as an out-param.
791 result ParseHostName(const Tizen::Base::String& str, int index, Tizen::Base::String& host);
794 // These methods verify components.
795 // If a given component is valid, return @c true, else, @c false.
796 // @param[in] str A component
798 bool VerifyScheme(const Tizen::Base::String& str) const;
799 bool VerifyAuthority(const Tizen::Base::String& str) const;
800 bool VerifyHost(const Tizen::Base::String& str) const;
801 bool VerifyPath(const Tizen::Base::String& str) const;
802 bool VerifyUserInfo(const Tizen::Base::String& str) const;
803 bool VerifyUriChar(const Tizen::Base::String& str) const;
806 // Checks that a given string only consists of server_based characters.
807 // @return @c true if a string consists of only server_based characters, @n
810 bool VerifyServerAuthority(const Tizen::Base::String& str) const;
813 // Checks that a given string only consists of registry_based characters.
814 // @return @c true if a string consists of only registry_based characters, @n
817 bool VerifyRegistryAuthority(const Tizen::Base::String& str) const;
820 // Checks whether a given char is a user-info character or not.
821 // user-info char: alphabet, digit, -_.!~*'(), ;:&=+$,
823 bool IsUserInfo(wchar_t mch) const;
826 // Returns true if a given wchar_t is a mark character.
827 // mark char : -_.!~*'()
829 bool IsMark(wchar_t mch) const;
832 // Returns true if two given wchar_ts are hexadecimals.
834 bool IsEscapedChar(wchar_t ch1, wchar_t ch2) const;
837 // Returns true if a given string is already encoded.
839 bool IsEncoded(const Tizen::Base::String& str) const;
842 // Returns true if a given wchar_t is an ISO control character.
844 bool IsControlChar(wchar_t ch) const;
847 // Compares @c pStr1 with @c pStr2. @n
848 // If @c pStr1 is greater than @c pStr2, returns @c 1.
849 // If two strings are the same, return @c 0.
850 // If @c pStr1 is less than @c pStr2, returns @c -1.
852 int Compare(const Tizen::Base::String& pStr1, const Tizen::Base::String& pStr2) const;
855 // Adds leading dots.
856 // If the normalized path is relative, and if the first segment could be parsed as a scheme name,
857 // then prepend a '.' segment
859 void AddLeadingDot(Tizen::Base::WcharBuffer& path, int* segments, int numSegments);
862 // Finds the first character in stopString.
863 // If there is not a character in stopString, the last index is returned.
865 int Scan(const Tizen::Base::String& str, int start, const Tizen::Base::String& stopString);
868 // Normalizes a given string and removes unnecessary dots.
870 Tizen::Base::String InternalNormalize(const Tizen::Base::String& path);
873 // Returns the number of segments from a given path.
875 int GetNumberOfSegments(const Tizen::Base::String& path) const;
877 // Join the segments in the given path according to the given segment-index array,
878 // ignoring those segments whose index entries have been set to @c -1, and inserting slashes as needed.
879 // Return the length of the resulting path.
882 // segs[i] == @c -1 implies segment i is to be ignored
883 // path computed by split, as above, with '\0' having replaced '/'
886 // path[0] .. path[return value] == Resulting path
888 int Join(Tizen::Base::WcharBuffer& path, int* segments, int segCount);
891 // Removes unnecessary dots and segment pairs consisting of a non-".." segment
892 // followed by a ".." segment
894 void RemoveDots(const Tizen::Base::WcharBuffer& mb, int* segments, int segCount, int length);
897 // Splits a path component into segments.
899 void SplitIntoSegments(Tizen::Base::WcharBuffer& mb, int* segments, int segCount);
902 // Implements Uri resolution in RFC2396 5.2
904 result Resolve(const Uri& baseUri, const Uri& childUri, Uri& resultUri);
907 // Resolves the path of the base and child URI.
909 Tizen::Base::String ResolvePath(const Tizen::Base::String& path, const Tizen::Base::String& resolve, bool isAbsolute);
911 bool EqualsComponent(const Tizen::Base::String& comp1, const Tizen::Base::String& comp2);
912 result Relativize(const Uri& baseUri, const Uri& childUri, Uri& resultUri);
915 // Converts a component represented by UTF8 to a component represented by Unicode.
917 Tizen::Base::String Decode(const Tizen::Base::String& str);
920 // Converts a component represented by Unicode to a component represented by UTF8.
922 Tizen::Base::String Encode(const Tizen::Base::String& str) const;
924 static result AppendEscape(Tizen::Base::String& strbuf, byte b);
927 // Clears the current instance.
932 Tizen::Base::String __scheme;
933 Tizen::Base::String __ssp;
934 Tizen::Base::String __authority;
935 Tizen::Base::String __host;
936 Tizen::Base::String __fragment;
937 Tizen::Base::String __path;
938 Tizen::Base::String __userInfo;
939 Tizen::Base::String __query;
940 Tizen::Base::String __ipv4;
941 Tizen::Base::String __ipv6;
944 Tizen::Base::String __encodedAuth;
945 Tizen::Base::String __encodedFragment;
946 Tizen::Base::String __encodedPath;
947 Tizen::Base::String __encodedQuery;
948 Tizen::Base::String __encodedSsp;
949 Tizen::Base::String __encodedUserInfo;
955 friend class _UriImpl;
956 class _UriImpl* __pUriImpl;
960 }}} // Tizen::Base::Utility
962 #endif //_FBASE_UTIL_URI_H_