|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-A8F13E5A-56F2-5C72-AF81-5AC062B94C6C" xml:lang="en"><title>Using |
|
13 URI Utilities </title><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <p>This tutorial describes the steps to use URI utilities. </p> |
|
15 <section><title>Introduction</title><p><xref href="GUID-265F8D6B-4B88-342A-BD7B-5934CC9437DA.dita"><apiname>UriUtils</apiname></xref> class checks |
|
16 URIs for invalid characters and has both 8 and 16-bit variants. It provides |
|
17 additional utilities for <xref href="GUID-E6F8C94C-C74C-329B-BB11-E06F0E83A4BB.dita"><apiname>CUri8</apiname></xref> and <xref href="GUID-3B5EC759-81D3-3A5E-B437-7AA3BD3124BA.dita"><apiname>CAuthority8</apiname></xref> classes. |
|
18 The method used to check URIs is <codeph>HasValidChars()</codeph>, which is |
|
19 passed through descriptor data to check and return a boolean indicating whether |
|
20 invalid characters were found or not. </p><p>You can create URI (<xref href="GUID-E6F8C94C-C74C-329B-BB11-E06F0E83A4BB.dita"><apiname>CUri8</apiname></xref> object) |
|
21 from a Unicode descriptor using <xref href="GUID-265F8D6B-4B88-342A-BD7B-5934CC9437DA.dita#GUID-265F8D6B-4B88-342A-BD7B-5934CC9437DA/GUID-8A9C278B-8DF6-3C5A-ADCB-8434B6DB6DFF"><apiname>UriUtils::CreateUriL()</apiname></xref>. |
|
22 Refer to <xref href="GUID-4D32A29F-6573-5233-8982-BDEEDDB4F0FF.dita">Creating an |
|
23 URI</xref> for details. </p> </section> |
|
24 <section><title>Validating URI for invalid characters</title><p> <xref href="GUID-EE23B21A-5198-3087-91D1-2332CE40B6CA.dita"><apiname>HasInvalidChars()</apiname></xref> checks |
|
25 for any excluded (also called invalid) characters in the URI to validate the |
|
26 invalid characters. The following are set of invalid characters: </p> <table id="GUID-6FF08B48-1395-58B7-B9EA-15D89A52F931"> |
|
27 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
28 <thead> |
|
29 <row> |
|
30 <entry>Category</entry> |
|
31 <entry>Character set</entry> |
|
32 </row> |
|
33 </thead> |
|
34 <tbody> |
|
35 <row> |
|
36 <entry><p>Control characters </p> </entry> |
|
37 <entry><p>Values <codeph>0x00</codeph> to <codeph>0x1F</codeph> and greater |
|
38 than <codeph>0x7F</codeph> </p> </entry> |
|
39 </row> |
|
40 <row> |
|
41 <entry><p>Space </p> </entry> |
|
42 <entry><p> <codeph>0x20</codeph> </p> </entry> |
|
43 </row> |
|
44 <row> |
|
45 <entry><p>Delimiters </p> </entry> |
|
46 <entry><p>'<', '>', '#', '%', '"' </p> </entry> |
|
47 </row> |
|
48 <row> |
|
49 <entry><p>Unwise characters </p> </entry> |
|
50 <entry><p>' {', '}', '|', '\', '^', '[', ']', '`' </p> </entry> |
|
51 </row> |
|
52 </tbody> |
|
53 </tgroup> |
|
54 </table> </section> |
|
55 <section><title>Validating URI for valid host </title><p><codeph>HostType()</codeph> validates |
|
56 the URI for the following valid host types as defined in <xref href="GUID-79125D4F-A803-36E7-AB56-D8ACB80D5FFE.dita"><apiname>TUriHostType</apiname></xref>:</p><ul> |
|
57 <li><p>IPv6, for example, <userinput>1080:0:0:0:8:800:200C:417A</userinput></p></li> |
|
58 <li><p>IPv4, for example, <userinput>192.168.202.18</userinput></p></li> |
|
59 <li><p>Text form, for example, <userinput>www.mywebpage.com</userinput> </p></li> |
|
60 </ul></section> |
|
61 </conbody><related-links> |
|
62 <link href="GUID-795B41AF-FBEA-56CE-AE20-EF17BE754723.dita"><linktext>HTTP Utilities |
|
63 Library Overview</linktext></link> |
|
64 <link href="GUID-4D32A29F-6573-5233-8982-BDEEDDB4F0FF.dita"><linktext>Creating |
|
65 an URI</linktext></link> |
|
66 </related-links></concept> |