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 methods for managing URI.
40 * The %Uri class represents a Uniform Resource Identifier (URI) as defined by RFC2396 and provides methods
42 * The %Uri class 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"https://developer.tizen.org");
59 * String against(L"/downloads/tizen-sdk");
60 * String resolveString(L"https://developer.tizen.org/downloads/tizen-sdk");
63 * baseUri.SetUri(base);
66 * againstUri.SetUri(against);
69 * baseUri.Resolve(againstUri, resultUri);
71 * String resultString = resultUri.ToString();
72 * if (resultString.Equals(resolveString))
79 class _OSP_EXPORT_ Uri
80 : public Tizen::Base::Object
84 * This is the default constructor for this class.
91 * Copying of objects using this copy constructor is allowed.
95 * @param[in] uri An instance of %Uri to copy
100 * This destructor overrides Tizen::Base::Object::~Object().
107 * Sets the current %Uri instance with the value of the specified %Uri instance.
111 * @param[in] uri An instance of %Uri to set
113 void SetUri(const Uri& uri);
116 * Sets the current %Uri instance by parsing the specified string.
120 * @return An error code
121 * @param[in] str The string to parse for URI value
122 * @exception E_SUCCESS The method is successful.
123 * @exception E_INVALID_ARG The specified @c str is an empty string.
124 * @exception E_INVALID_FORMAT The specified @c str violates the URI syntax (RFC 2396).
126 result SetUri(const Tizen::Base::String& str);
129 * Sets an absolute %Uri instance with specified components.
133 * @return An error code
134 * @param[in] scheme The scheme
135 * @param[in] ssp The scheme-specific-part
136 * @param[in] fragment The fragment
137 * @exception E_SUCCESS The method is successful.
138 * @exception E_INVALID_FORMAT A specified component violates the URI syntax(RFC 2396).
140 result SetUri(const Tizen::Base::String& scheme, const Tizen::Base::String& ssp, const Tizen::Base::String& fragment);
143 * Sets an absolute and hierarchical %Uri instance with the given components.
147 * @return An error code
148 * @param[in] scheme The scheme
149 * @param[in] userInfo The user name and authorization
150 * @param[in] host The host name
151 * @param[in] port The port number
152 * @param[in] path The path
153 * @param[in] query The query
154 * @param[in] fragment The fragment
155 * @exception E_SUCCESS The method is successful.
156 * @exception E_INVALID_FORMAT A specified component violates the URI syntax(RFC 2396).
158 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);
161 * Sets an absolute and hierarchical %Uri instance with the given components.
165 * @return An error code
166 * @param[in] scheme The scheme
167 * @param[in] host The host name
168 * @param[in] path The path
169 * @param[in] fragment The fragment
170 * @exception E_SUCCESS The method is successful.
171 * @exception E_INVALID_FORMAT A specified component violates the URI syntax(RFC 2396).
172 * @remarks The authority and query component are left empty, and the port is set to @c -1.
174 result SetUri(const Tizen::Base::String& scheme, const Tizen::Base::String& host, const Tizen::Base::String& path, const Tizen::Base::String& fragment);
177 * Sets an absolute and hierarchical %Uri instance with the given components.
181 * @return An error code
182 * @param[in] scheme The scheme
183 * @param[in] authority The authority
184 * @param[in] path The path
185 * @param[in] query The query
186 * @param[in] fragment The fragment
187 * @exception E_SUCCESS The method is successful.
188 * @exception E_INVALID_FORMAT A specified component violates the URI syntax(RFC 2396).
190 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);
193 * Copying of objects using this copy assignment operator is allowed.
197 * @return A reference to the calling instance
198 * @param[in] rhs An instance of %Uri
200 Uri& operator =(const Uri& rhs);
203 * Gets the value of the authority component.
207 * @return The value of the authority component, @n
208 * else an empty string if the authority component is undefined
209 * @remarks The string returned by this method is equal to the string returned by GetEncodedAuthority(),
210 * except that all the sequences of the escaped octets are decoded.
212 Tizen::Base::String GetAuthority(void) const;
215 * Gets the value of the fragment component.
219 * @return The value of the fragment component, @n
220 * else an empty string if the fragment component is undefined
221 * @remarks The string returned by this method is equal to the string returned by GetEncodedFragment(),
222 * except that all the sequences of the escaped octets are decoded.
224 Tizen::Base::String GetFragment(void) const;
227 * Gets the value of the host component.
231 * @return The value of the host component, @n
232 * else an empty string if the host component is undefined
234 Tizen::Base::String GetHost(void) const;
237 * Gets the value of the path component.
241 * @return The value of the path component, @n
242 * else an empty string if the path component is undefined
243 * @remarks The string returned by this method is equal to the string returned by GetEncodedPath(),
244 * except that all the sequences of the escaped octets are decoded.
246 Tizen::Base::String GetPath(void) const;
250 * Gets the value of the port component.
254 * @return The value of the port component, @n
255 * else @c -1 if the port component is undefined
257 int GetPort(void) const;
261 * Gets the value of the query component.
265 * @return The value of the query component, @n
266 * else an empty string if the query component is undefined
267 * @remarks The string returned by this method is equal to the string returned by GetEncodedQuery(),
268 * except that all the sequences of the escaped octets are decoded.
270 Tizen::Base::String GetQuery(void) const;
274 * Gets the value of the scheme component.
278 * @return The value of the query scheme, @n
279 * else an empty string if the query scheme is undefined
281 Tizen::Base::String GetScheme(void) const;
285 * Gets the value of the scheme-specific-part component.
289 * @return The value of the scheme-specific-part component, @n
290 * else an empty string if the scheme-specific-part component is undefined
291 * @remarks The string returned by this method is equal to the string returned by GetEncodedSchemeSpecificPart(),
292 * except that all the sequences of the escaped octets are decoded.
294 Tizen::Base::String GetSchemeSpecificPart(void) const;
298 * Gets the value of the user-info component.
302 * @return The value of the user-info component, @n
303 * else an empty string if the user-info component is undefined
304 * @remarks The string returned by this method is equal to the string returned by GetEncodedUserInfo(),
305 * except that all the sequences of the escaped octets are decoded.
307 Tizen::Base::String GetUserInfo(void) const;
311 * Gets the encoded value of the authority component. @n
312 * The non-US-ASCII characters in the authority component are encoded to escaped octets.
316 * @return The encoded value of the authority component, @n
317 * else an empty string if the authority component is undefined
319 Tizen::Base::String GetEncodedAuthority(void) const;
323 * Gets the encoded value of the fragment component. @n
324 * The non-US-ASCII characters in the fragment component are encoded to escaped octets.
328 * @return The encoded value of the fragment component, @n
329 * else an empty string if the fragment component is undefined
331 Tizen::Base::String GetEncodedFragment(void) const;
335 * Gets the encoded value of the path component. @n
336 * The non-US-ASCII characters in the path component are encoded to escaped octets.
340 * @return The encoded value of the path component, @n
341 * else an empty string if the path component is undefined
343 Tizen::Base::String GetEncodedPath(void) const;
347 * Gets the encoded value of the query component. @n
348 * The non-US-ASCII characters in the query component are encoded to escaped octets.
352 * @return The encoded value of the query component, @n
353 * else an empty string if the query component is undefined
355 Tizen::Base::String GetEncodedQuery(void) const;
359 * Gets the encoded value of the scheme-specific-part component. @n
360 * The non-US-ASCII characters in the scheme-specific-part component are encoded to escaped octets.
364 * @return The encoded value of the scheme-specific-part component, @n
365 * else an empty string if the scheme-specific-part component is undefined
367 Tizen::Base::String GetEncodedSchemeSpecificPart(void) const;
370 * Gets the encoded value of a user-info component,
371 * or returns an empty string if the user-info component is undefined. @n
372 * The non-US-ASCII characters in the user-info component are encoded to escaped octets.
376 * @return The encoded value of user-info, @n
377 * else an empty string if the user-info component is undefined
379 Tizen::Base::String GetEncodedUserInfo(void) const;
383 * Checks whether the current %Uri instance is an absolute URI.
387 * @return @c true if the current %Uri instance is an absolute URI, @n
390 bool IsAbsolute(void) const;
394 * Checks whether the current %Uri instance is an opaque URI.
398 * @return @c true if the current %Uri instance is an opaque URI, @n
401 bool IsOpaque(void) const;
405 * Gets the encoded US-ASCII string.
409 * @return The encoded US-ASCII string
410 * @remarks If this URI does not contain any non US_ASCII characters,
411 * then the string returned by this method is equal to the string returned by ToString().
413 * The following example demonstrates how to use the %GetEncodedString() method.
416 * String str(L"https://www.tizen.org/?currency==\u20ac");
421 * String encode = uri.GetEncodedString(); // encode == L"https://www.tizen.org/?currency==%E2%82%AC"
425 Tizen::Base::String GetEncodedString(void) const;
428 * Compares the current URI instance with the specified %Uri instance. @n
429 * When comparing corresponding components of two URIs, if one component in the current instance is undefined
430 * but the other is defined, then the current instance is considered to be less than the given object.
434 * @return The result of the comparison
436 * < 0 if the current instance is less than the given object
437 * = 0 if the current instance is equal to the given object
438 * > 0 if the current instance is greater than the given object
440 * @param[in] uri An instance of %Uri to compare
445 * Two URIs are ordered according to the ordering of schemes, without regard to case.
446 * 2. Hierarchical URI vs. Opaque URI
447 * A hierarchical URI is less than an opaque URI if they have an identical scheme.
448 * 3. Scheme-specific-part
449 * If two opaque URIs have an identical scheme, they are ordered according to
450 * the scheme-specific-part, without regard to %case.
452 * If two opaque URIs have identical schemes and scheme-specific-parts, they are ordered according
453 * to the ordering of fragments, without regard to case.
455 * If two hierarchical URIs have identical schemes, they are ordered according to the authority,
456 * without regard to the case. @n
457 * 5-1. Server-based authority
458 * If two URIs are server-based, they are ordered according to their user-information,
459 * without regard to case.
460 * If the hosts are identical, then the URIs are ordered according to the ordering of ports.
462 * If two hierarchical URIs have identical schemas and authority components, they are ordered according to the
463 * ordering of paths, without regard to the case.
464 * If their paths are identical, their queries are compared. And if the queries are the same, then their fragments
468 int CompareTo(const Uri& uri) const;
472 * Compares the specified instance to the current instance.
476 * @return @c true if the two instances are equal, @n
478 * @param[in] obj The object to compare with the current instance
480 * - Two equal instances must return the same hash value. @n The default
481 * implementation of this method returns @c true if the two instances
482 * have the same address.
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. @n
496 * For better performance, 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.
510 * If a ".." segment is preceded by a non-".." segment,
511 * both the segments are removed. If a URI is opaque, the normalization has no effect.
513 * The following example demonstrates how to use the %Normalize() method.
517 * uri1.SetUri(L"http://www.example.com/a/b/../c/./d.html");
519 * Uri uriNormalized = uri1.Normalize();
520 * String uriStr = uriNormalized.ToString(); // uriStr == L"http://www.example.com/a/c/d.html"
528 * Parses the server-based authority component, if defined.
532 * @return An error code
533 * @param[out] uri The parsed URI
534 * @exception E_SUCCESS The method is successful.
535 * @exception E_INVALID_FORMAT The authority component is defined but cannot be parsed as a server-based authority.
536 * @remarks This method is provided because the generic URI syntax cannot always distinguish a malformed server-based authority from a legitimate registry-based authority. @n
537 * For example, the authority component in the URI string "//foo:bar/" is not a legal
538 * server-based authority but it is legal as a registry-based authority.
540 result ParseAuthority(Uri& uri);
544 * Relativizes the specified %Uri instance against the current %Uri instance.
548 * @return An error code
549 * @param[in] uri The %Uri to relativize against the current %Uri instance
550 * @param[out] resultUri The relativized URI
551 * @exception E_SUCCESS The method is successful.
552 * @exception E_OUT_OF_MEMORY The memory is insufficient.
554 * - Relativization is the opposite of Resolution.
555 * - It is used to divide a URI into the base URI and the relative URI.
557 result Relativize(const Uri& uri, Uri& resultUri);
561 * Resolves the specified %Uri instance against the current %Uri instance.
565 * @return An error code
566 * @param[in] uri The URI to resolve against this URI
567 * @param[out] resultUri The resolved URI
568 * @exception E_SUCCESS The method is successful.
569 * @exception E_OUT_OF_MEMORY The memory is insufficient.
571 * - Resolution is the process of resolving a URI against another, base URI.
572 * - For a hierarchical URI, the path of the original URI is resolved against the path of the base URI and then normalized. @n
573 * For example, when you resolve the URI "/downloads/tizen-sdk" against the base URI "https://developer.tizen.org",
574 * the resultant URI is "https://developer.tizen.org/downloads/tizen-sdk".
576 result Resolve(const Uri& uri, Uri& resultUri);
580 * Sets the authority component to the specified String instance.
584 * @return An error code
585 * @param[in] authority The authority to set
586 * @exception E_SUCCESS The method is successful.
587 * @exception E_INVALID_FORMAT The specified string is invalid.
589 result SetAuthority(const Tizen::Base::String& authority);
593 * Sets the fragment component to the specified String instance
597 * @return An error code
598 * @param[in] fragment The fragment to set
599 * @exception E_SUCCESS The method is successful.
600 * @exception E_INVALID_FORMAT The specified string is invalid.
602 result SetFragment(const Tizen::Base::String& fragment);
606 * Sets the host component to the specified String instance.
610 * @return An error code
611 * @param[in] host The host to set
612 * @exception E_SUCCESS The method is successful.
613 * @exception E_INVALID_FORMAT The specified string is invalid.
615 result SetHost(const Tizen::Base::String& host);
619 * Sets the path component to the specified String instance.
623 * @return An error code
624 * @param[in] path The path to set
625 * @exception E_SUCCESS The method is successful.
626 * @exception E_INVALID_FORMAT The specified string is invalid.
628 result SetPath(const Tizen::Base::String& path);
632 * Sets the port component to a given integer.
636 * @return An error code
637 * @param[in] port The port to set
638 * @exception E_SUCCESS The method is successful.
639 * @exception E_INVALID_ARG The specified @c port is negative.
641 result SetPort(int port);
645 * Sets the query component to the specified String instance.
649 * @return An error code
650 * @param[in] query The query to set
651 * @exception E_SUCCESS The method is successful.
652 * @exception E_INVALID_FORMAT The specified string is invalid.
654 result SetQuery(const Tizen::Base::String& query);
658 * Sets the scheme component to the specified String instance.
662 * @return An error code
663 * @param[in] scheme The scheme to set
664 * @exception E_SUCCESS The method is successful.
665 * @exception E_INVALID_FORMAT The specified string is invalid.
667 result SetScheme(const Tizen::Base::String& scheme);
671 * Sets the scheme-specific-part component to the specified String instance.
675 * @return An error code
676 * @param[in] ssp The scheme-specific-part to set
677 * @exception E_SUCCESS The method is successful.
678 * @exception E_INVALID_FORMAT The specified string is invalid.
680 result SetSchemeSpecificPart(const Tizen::Base::String& ssp);
684 * Sets the user-info component to the specified String instance.
688 * @return An error code
689 * @param[in] userInfo The user-info to set
690 * @exception E_SUCCESS The method is successful.
691 * @exception E_INVALID_FORMAT The specified string is invalid.
693 result SetUserInfo(const Tizen::Base::String& userInfo);
697 * Gets the content of the current %Uri instance as a string containing escaped octets.
701 * @return The content of the current %Uri instance as a string containing escaped octets
703 Tizen::Base::String ToString(void) const;
707 // Constructs an Uri instance with the given components.
708 // scheme, ssp(opaquePart), authority, user-info, host, port, path, query, fragment
710 result SetUri(const Tizen::Base::String& scheme, const Tizen::Base::String& opaque,
711 const Tizen::Base::String& authority, const Tizen::Base::String& userInfo,
712 const Tizen::Base::String& host, int port, const Tizen::Base::String& path,
713 const Tizen::Base::String& query, const Tizen::Base::String& fragment);
716 // Appends a given scheme-specific-part to a String.
718 result AppendSchemeSpecificPart(Tizen::Base::String& strbuf, const Tizen::Base::String& opaque,
719 const Tizen::Base::String& authority, const Tizen::Base::String& userInfo,
720 const Tizen::Base::String& host, int port, const Tizen::Base::String& path,
721 const Tizen::Base::String& query) const;
724 // Appends a given fragment to a String.
726 result AppendFragment(Tizen::Base::String& strbuf, const Tizen::Base::String& fragment) const;
729 // Appends a given authority component to a String.
731 result AppendAuthority(Tizen::Base::String& strbuf, const Tizen::Base::String& authority,
732 const Tizen::Base::String& userInfo, const Tizen::Base::String& host, int port) const;
735 // Parses a given URI string.
737 result ParseUri(const Tizen::Base::String& str);
740 // Copies a given URI.
742 result CopyUri(const Uri& uri);
745 // Encodes all components - authority, fragment, path, query, and ssp.
747 void EncodeAllComponent(void);
750 // Parses a hierarchical URI string.
751 // @return The start index of the fragment. If the operation fails, @c -1 is returned.
752 // @param[in] startSsp The start index of scheme-specific-part
753 // @param[in] lengthOfUri The length of the URI string
754 // @param[out] authority A parsed authority component
755 // @param[out] path A parsed path component
756 // @param[out] query A parsed query component
758 result ParseHierarchicalUri(const Tizen::Base::String& str, int startSsp, Tizen::Base::String& authority,
759 Tizen::Base::String& path, Tizen::Base::String& query, int& index);
763 // Parses a server_based authority component.
764 // server_based authority: [user-info@]<host>[:port]
766 result ParseAuthority(const Tizen::Base::String& str, int curIndex, Tizen::Base::String& newAuth,
767 Tizen::Base::String& userInfo, Tizen::Base::String& host, int& port);
769 void SetAndEncodeAuthority(const Tizen::Base::String& authority,
770 const Tizen::Base::String& path, const Tizen::Base::String& query);
773 // Parses a server_based authority component.
774 // Assigns user-info, host and port to their member variable.
776 result ParseServerAuthority(const Tizen::Base::String& str, Tizen::Base::String& user, Tizen::Base::String& host, int& port);
779 // Parses an IPv4 address.
781 result ParseIpv4(const Tizen::Base::String& str, int index, int& count);
784 // Parses an IPv6 address.
785 // It will be implemented.
787 result ParseIpv6(const Tizen::Base::String& ip6, Tizen::Base::String& outIpv6);
790 // Parses a host name and returns a host name as an out-param.
792 result ParseHostName(const Tizen::Base::String& str, int index, Tizen::Base::String& host);
795 // These methods verify components.
796 // If a given component is valid, return @c true, else, @c false.
797 // @param[in] str A component
799 bool VerifyScheme(const Tizen::Base::String& str) const;
800 bool VerifyAuthority(const Tizen::Base::String& str) const;
801 bool VerifyHost(const Tizen::Base::String& str) const;
802 bool VerifyPath(const Tizen::Base::String& str) const;
803 bool VerifyUserInfo(const Tizen::Base::String& str) const;
804 bool VerifyUriChar(const Tizen::Base::String& str) const;
807 // Checks that a given string only consists of server_based characters.
808 // @return @c true if a string consists of only server_based characters, @n
811 bool VerifyServerAuthority(const Tizen::Base::String& str) const;
814 // Checks that a given string only consists of registry_based characters.
815 // @return @c true if a string consists of only registry_based characters, @n
818 bool VerifyRegistryAuthority(const Tizen::Base::String& str) const;
821 // Checks whether a given char is a user-info character or not.
822 // user-info char: alphabet, digit, -_.!~*'(), ;:&=+$,
824 bool IsUserInfo(wchar_t mch) const;
827 // Returns true if a given wchar_t is a mark character.
828 // mark char : -_.!~*'()
830 bool IsMark(wchar_t mch) const;
833 // Returns true if two given wchar_ts are hexadecimals.
835 bool IsEscapedChar(wchar_t ch1, wchar_t ch2) const;
838 // Returns true if a given string is already encoded.
840 bool IsEncoded(const Tizen::Base::String& str) const;
843 // Returns true if a given wchar_t is an ISO control character.
845 bool IsControlChar(wchar_t ch) const;
848 // Compares @c pStr1 with @c pStr2. @n
849 // If @c pStr1 is greater than @c pStr2, returns @c 1.
850 // If two strings are the same, return @c 0.
851 // If @c pStr1 is less than @c pStr2, returns @c -1.
853 int Compare(const Tizen::Base::String& pStr1, const Tizen::Base::String& pStr2) const;
856 // Adds leading dots.
857 // If the normalized path is relative, and if the first segment could be parsed as a scheme name,
858 // then prepend a '.' segment
860 void AddLeadingDot(Tizen::Base::WcharBuffer& path, int* segments, int numSegments);
863 // Finds the first character in stopString.
864 // If there is not a character in stopString, the last index is returned.
866 int Scan(const Tizen::Base::String& str, int start, const Tizen::Base::String& stopString);
869 // Normalizes a given string and removes unnecessary dots.
871 Tizen::Base::String InternalNormalize(const Tizen::Base::String& path);
874 // Returns the number of segments from a given path.
876 int GetNumberOfSegments(const Tizen::Base::String& path) const;
878 // Join the segments in the given path according to the given segment-index array,
879 // ignoring those segments whose index entries have been set to @c -1, and inserting slashes as needed.
880 // Return the length of the resulting path.
883 // segs[i] == @c -1 implies segment i is to be ignored
884 // path computed by split, as above, with '\0' having replaced '/'
887 // path[0] .. path[return value] == Resulting path
889 int Join(Tizen::Base::WcharBuffer& path, int* segments, int segCount);
892 // Removes unnecessary dots and segment pairs consisting of a non-".." segment
893 // followed by a ".." segment
895 void RemoveDots(const Tizen::Base::WcharBuffer& mb, int* segments, int segCount, int length);
898 // Splits a path component into segments.
900 void SplitIntoSegments(Tizen::Base::WcharBuffer& mb, int* segments, int segCount);
903 // Implements Uri resolution in RFC2396 5.2
905 result Resolve(const Uri& baseUri, const Uri& childUri, Uri& resultUri);
908 // Resolves the path of the base and child URI.
910 Tizen::Base::String ResolvePath(const Tizen::Base::String& path, const Tizen::Base::String& resolve, bool isAbsolute);
912 bool EqualsComponent(const Tizen::Base::String& comp1, const Tizen::Base::String& comp2);
913 result Relativize(const Uri& baseUri, const Uri& childUri, Uri& resultUri);
916 // Converts a component represented by UTF8 to a component represented by Unicode.
918 Tizen::Base::String Decode(const Tizen::Base::String& str);
921 // Converts a component represented by Unicode to a component represented by UTF8.
923 Tizen::Base::String Encode(const Tizen::Base::String& str) const;
925 static result AppendEscape(Tizen::Base::String& strbuf, byte b);
928 // Clears the current instance.
933 Tizen::Base::String __scheme;
934 Tizen::Base::String __ssp;
935 Tizen::Base::String __authority;
936 Tizen::Base::String __host;
937 Tizen::Base::String __fragment;
938 Tizen::Base::String __path;
939 Tizen::Base::String __userInfo;
940 Tizen::Base::String __query;
941 Tizen::Base::String __ipv4;
942 Tizen::Base::String __ipv6;
945 Tizen::Base::String __encodedAuth;
946 Tizen::Base::String __encodedFragment;
947 Tizen::Base::String __encodedPath;
948 Tizen::Base::String __encodedQuery;
949 Tizen::Base::String __encodedSsp;
950 Tizen::Base::String __encodedUserInfo;
956 friend class _UriImpl;
957 class _UriImpl* __pUriImpl;
961 }}} // Tizen::Base::Utility
963 #endif //_FBASE_UTIL_URI_H_