diff -r 51a74ef9ed63 -r ae94777fff8f Symbian3/SDK/Source/GUID-AFAD0F36-330B-50BD-B810-85BE7FA21179.dita --- a/Symbian3/SDK/Source/GUID-AFAD0F36-330B-50BD-B810-85BE7FA21179.dita Wed Mar 31 11:11:55 2010 +0100 +++ b/Symbian3/SDK/Source/GUID-AFAD0F36-330B-50BD-B810-85BE7FA21179.dita Fri Jun 11 12:39:03 2010 +0100 @@ -1,103 +1,103 @@ - - - - - -HTTP -Utilities Library (InetProtUtils) Example -
Download

Click -on the following link to download the example: ExampleInetProtUtil.zip

Click: browse to view the example code.

-
Description

This example code demonstrates -the usage of utilities provided by the InetProtUtil API. The users should -have a prior knowledge of concepts associated with it, such as URLs and URI -components.

The central class is CExampleInetProtUtil, -which demonstrates the following functionality:

    -
  • Creating a URI

  • -
  • Modifying a URI

  • -
  • Resolving a URI

  • -
  • Parsing a URI

  • -
  • Validating a URI

  • -
  • Extracting URI components

  • -
  • Retrieving a filename from a URI

  • -
  • Adding and removing delimiters from a URI

  • -
  • Removing whitespace from a URI

  • -
  • Escape encoding and decoding a URI

  • -

Creating a URI

void CExampleInetProtUtil::CreateUri();

Creates -a URI with respect to the physical path of a given file.

For example, -the physical path of the file:

K:/ws/direct/direct.mmp

gives -the following URI file:

///k/ws/direct/direct.mmp

The -screen output from this example is:

- -

Modifying a URI

void CExampleInetProtUtil::ModifyUriComponents();

Modifies -URI components, which involves:

    -
  1. Adding URI components, -where it constructs the URI component by component. For example, you can add -the following components:

      -
    • scheme: http

    • -
    • host: waterlang.org

    • -
    • path: main_page.html

    • -
    • port: 8080

    • -

    to get the complete URI:

    http://waterlang.org:8080/main_page.html

    The -screen output from this example is:

    - -
  2. -
  3. Removing the specific -URI component(s) from a constructed URI. For example, the above URI with the -port number removed:

    http://waterlang.org/main_page.html

    The -screen output from this example is:

    - -
  4. -

Resolving a URI

void CExampleInetProtUtil::ResolveUri();

Resolves -the URI, which involves creation of an absolute CUri object -from a given reference URI.

The screen output from this example is:

- -

Parsing a URI

void CExampleInetProtUtil::ParseUri();

Parses -the URI into its components (as given in RFC2396). The five URI components are:

    -
  • scheme

  • -
  • authority

  • -
  • path

  • -
  • query

  • -
  • fragment.

  • -

The screen output from this example is:

- -

Validating a URI

void CExampleInetProtUtil::ValidateUriComponents();

Validates -a given URI. This function is usually used for URIs with SIP as the scheme.

The -screen output from this example is:

- -

Extracting URI -components

void CExampleInetProtUtil::ExtractUriComponents();

Extracts -URI components from the given URI.

The screen output from this example -is:

- -

Retrieving a filename -from a URI

void CExampleInetProtUtil::RetrieveFileName();

Extracts -the actual physical location of the file from its URI.

The screen -output from this example is:

- -

Adding and removing -delimiters from a URI

void CExampleInetProtUtil::ModifyDelimiter();

Adds the delimiters to and removes the delimiters from a URI. Before -doing this ensure that:

    -
  • the delimiter is set -using SetDelimiter()

  • -
  • the URI has already -been parsed.

  • -

The screen output from this example is:

- -

Removing whitespace -from a URI

void CExampleInetProtUtil::WhiteSpaceRemover();

Removes -the whitespace from the given URI and returns the number of white spaces that -were removed.

The screen output from this example is:

- -

Escape encoding -and decoding a URI

void CExampleInetProtUtil::EscapeEncodeDecode();

Escape encodes the characters in a given URI as escape triplets and decodes -it to the original one.

The screen output from this example is:

- -
-
Class Summary

CUri8

TUriParser8

EscapeUtils

TDelimitedParserBase8

InetProtTextUtils

+ + + + + +HTTP +Utilities Library (InetProtUtils) Example +
Download

Click +on the following link to download the example: ExampleInetProtUtil.zip

Click: browse to view the example code.

+
Description

This example code demonstrates +the usage of utilities provided by the InetProtUtil API. The users should +have a prior knowledge of concepts associated with it, such as URLs and URI +components.

The central class is CExampleInetProtUtil, +which demonstrates the following functionality:

    +
  • Creating a URI

  • +
  • Modifying a URI

  • +
  • Resolving a URI

  • +
  • Parsing a URI

  • +
  • Validating a URI

  • +
  • Extracting URI components

  • +
  • Retrieving a filename from a URI

  • +
  • Adding and removing delimiters from a URI

  • +
  • Removing whitespace from a URI

  • +
  • Escape encoding and decoding a URI

  • +

Creating a URI

void CExampleInetProtUtil::CreateUri();

Creates +a URI with respect to the physical path of a given file.

For example, +the physical path of the file:

K:/ws/direct/direct.mmp

gives +the following URI file:

///k/ws/direct/direct.mmp

The +screen output from this example is:

+ +

Modifying a URI

void CExampleInetProtUtil::ModifyUriComponents();

Modifies +URI components, which involves:

    +
  1. Adding URI components, +where it constructs the URI component by component. For example, you can add +the following components:

      +
    • scheme: http

    • +
    • host: waterlang.org

    • +
    • path: main_page.html

    • +
    • port: 8080

    • +

    to get the complete URI:

    http://waterlang.org:8080/main_page.html

    The +screen output from this example is:

    + +
  2. +
  3. Removing the specific +URI component(s) from a constructed URI. For example, the above URI with the +port number removed:

    http://waterlang.org/main_page.html

    The +screen output from this example is:

    + +
  4. +

Resolving a URI

void CExampleInetProtUtil::ResolveUri();

Resolves +the URI, which involves creation of an absolute CUri object +from a given reference URI.

The screen output from this example is:

+ +

Parsing a URI

void CExampleInetProtUtil::ParseUri();

Parses +the URI into its components (as given in RFC2396). The five URI components are:

    +
  • scheme

  • +
  • authority

  • +
  • path

  • +
  • query

  • +
  • fragment.

  • +

The screen output from this example is:

+ +

Validating a URI

void CExampleInetProtUtil::ValidateUriComponents();

Validates +a given URI. This function is usually used for URIs with SIP as the scheme.

The +screen output from this example is:

+ +

Extracting URI +components

void CExampleInetProtUtil::ExtractUriComponents();

Extracts +URI components from the given URI.

The screen output from this example +is:

+ +

Retrieving a filename +from a URI

void CExampleInetProtUtil::RetrieveFileName();

Extracts +the actual physical location of the file from its URI.

The screen +output from this example is:

+ +

Adding and removing +delimiters from a URI

void CExampleInetProtUtil::ModifyDelimiter();

Adds the delimiters to and removes the delimiters from a URI. Before +doing this ensure that:

    +
  • the delimiter is set +using SetDelimiter()

  • +
  • the URI has already +been parsed.

  • +

The screen output from this example is:

+ +

Removing whitespace +from a URI

void CExampleInetProtUtil::WhiteSpaceRemover();

Removes +the whitespace from the given URI and returns the number of white spaces that +were removed.

The screen output from this example is:

+ +

Escape encoding +and decoding a URI

void CExampleInetProtUtil::EscapeEncodeDecode();

Escape encodes the characters in a given URI as escape triplets and decodes +it to the original one.

The screen output from this example is:

+ +
+
Class Summary

CUri8

TUriParser8

EscapeUtils

TDelimitedParserBase8

InetProtTextUtils

\ No newline at end of file