GNU
|
Liberty Eiffel
|
Automated Tests
|
Wiki
|
Savannah project
|
Debian packages
|
Documentation
>
libraries
>
NETWORK_RESOURCE_LOCATOR
+
Point of view
All features
ANY
RECYCLING_POOL
URL_VALIDITY
URL
TCP_PROTOCOL
All features
class NETWORK_RESOURCE_LOCATOR
Summary
top
Provides meaning to a network
URL
(Universal Resource Locator) strings, by the use of accessors to different parts of it:
protocol
,
username
,
password
,
host
,
port
,
path
,
arguments
and
anchor
are different parts of the
URL
:
protocol://username:password@host:port/path?arguments#anchor
See also
RFC 1738
Direct parents
Inherit list:
RESOURCE_LOCATOR
Insert list:
NETWORK_RESOURCE_VALIDITY
Class invariant
top
has_host:
not
host
.is_empty
meaningful_port:
port
>= 0
has_path:
not
path
.is_empty
Overview
top
Creation features
{
TCP_PROTOCOL
}
set_uri
(a_uri:
STRING
)
Features
{
TCP_PROTOCOL
}
set_uri
(a_uri:
STRING
)
{
ANY
}
uri
:
STRING
{
URL_VALIDITY
}
valid_uri
(a_uri:
STRING
):
BOOLEAN
{
URL
}
absolute_uri
(a_uri:
STRING
):
BOOLEAN
relative_uri
(a_uri:
STRING
):
BOOLEAN
set_relative
(a_uri:
STRING
)
{
ANY
}
username
:
STRING
The optional user name.
password
:
STRING
The optional password.
host
:
STRING
The host name.
port
:
INTEGER_32
The port; 0 means use the standard port of the protocol.
path
:
STRING
The path.
arguments
:
STRING
The optional arguments.
anchor
:
STRING
The optional anchor.
{}
set_host
(a_host:
STRING
)
Sets the host name.
set_port
(a_port:
INTEGER_32
)
Sets the port number; 0 means use the standard port of the protocol.
set_username
(a_username:
STRING
)
Sets an optional user name; Void clears it.
set_password
(a_password:
STRING
)
Sets an optional password; Void clears it.
set_path
(a_path:
STRING
)
Sets the path.
set_arguments
(a_argument_name:
STRING
, a_argument_value:
STRING
)
Sets an optional argument.
set_anchor
(a_anchor:
STRING
)
Sets an optional anchor.
uri_string
(a_user:
STRING
, a_pwd:
STRING
, a_host:
STRING
, a_port:
INTEGER_32
, a_path:
STRING
, a_args:
STRING
, a_anchor:
STRING
):
STRING
{}
encode
(string:
STRING
):
STRING
decode
(string:
STRING
):
STRING
string_pool
:
STRING_RECYCLING_POOL
{
RECYCLING_POOL
}
recycle
Do whatever needs to be done to free resources or recycle other objects when recycling this one
{
ANY
}
is_equal
(other: NETWORK_RESOURCE_LOCATOR):
BOOLEAN
Is
other
attached to an object considered equal to current object?
{}
is_relative_uri
(a_uri:
STRING
):
BOOLEAN
is_absolute_uri
(a_uri:
STRING
):
BOOLEAN
True if
a_uri
contains a correctly formatted network URI (i.e. everything except the protocol scheme)
{}
notation
:
UNIX_DIRECTORY_NOTATION
set_uri
(a_uri:
STRING
)
effective procedure
{
TCP_PROTOCOL
}
top
uri
:
STRING
effective function
{
ANY
}
top
valid_uri
(a_uri:
STRING
):
BOOLEAN
effective function
{
URL_VALIDITY
}
top
absolute_uri
(a_uri:
STRING
):
BOOLEAN
effective function
{
URL
}
top
require
valid_uri(a_uri)
relative_uri
(a_uri:
STRING
):
BOOLEAN
effective function
{
URL
}
top
require
valid_uri(a_uri)
set_relative
(a_uri:
STRING
)
effective procedure
{
URL
}
top
require
relative_uri(a_uri)
username
:
STRING
writable attribute
{
ANY
}
top
The optional user name.
password
:
STRING
writable attribute
{
ANY
}
top
The optional password.
host
:
STRING
writable attribute
{
ANY
}
top
The host name.
port
:
INTEGER_32
writable attribute
{
ANY
}
top
The port; 0 means use the standard port of the protocol.
path
:
STRING
writable attribute
{
ANY
}
top
The path.
arguments
:
STRING
writable attribute
{
ANY
}
top
The optional arguments.
anchor
:
STRING
writable attribute
{
ANY
}
top
The optional anchor.
set_host
(a_host:
STRING
)
effective procedure
{}
top
Sets the host name.
require
not a_host.is_empty
ensure
host
.is_equal(a_host)
set_port
(a_port:
INTEGER_32
)
effective procedure
{}
top
Sets the port number; 0 means use the standard port of the protocol.
require
a_port >= 0
ensure
port
= a_port
set_username
(a_username:
STRING
)
effective procedure
{}
top
Sets an optional user name; Void clears it.
ensure
username
.is_equal(a_username)
set_password
(a_password:
STRING
)
effective procedure
{}
top
Sets an optional password; Void clears it.
require
a_password /= Void implies
username
/= Void
ensure
password
.is_equal(a_password)
set_path
(a_path:
STRING
)
effective procedure
{}
top
Sets the path.
require
not a_path.is_empty
ensure
path
.is_equal(a_path)
set_arguments
(a_argument_name:
STRING
, a_argument_value:
STRING
)
effective procedure
{}
top
Sets an optional argument.
May be called more than once to add more arguments. A Void name clears all the arguments.
require
a_argument_value /= Void implies a_argument_name /= Void
set_anchor
(a_anchor:
STRING
)
effective procedure
{}
top
Sets an optional anchor.
ensure
a_anchor = Void implies
anchor
= Void
a_anchor /= Void implies
anchor
.is_equal(a_anchor)
uri_string
(a_user:
STRING
, a_pwd:
STRING
, a_host:
STRING
, a_port:
INTEGER_32
, a_path:
STRING
, a_args:
STRING
, a_anchor:
STRING
):
STRING
effective function
{}
top
encode
(string:
STRING
):
STRING
effective function
{}
top
require
string /= Void
ensure
Result /= Void
decode
(string:
STRING
):
STRING
effective function
{}
top
require
string /= Void
string_pool
:
STRING_RECYCLING_POOL
once function
{}
top
recycle
effective procedure
{
RECYCLING_POOL
}
top
Do whatever needs to be done to free resources or recycle other objects when recycling this one
is_equal
(other: NETWORK_RESOURCE_LOCATOR):
BOOLEAN
effective function
{
ANY
}
top
Is
other
attached to an object considered equal to current object?
require
other /= Void
ensure
commutative:
generating_type = other.generating_type implies Result = other.is_equal(Current)
is_relative_uri
(a_uri:
STRING
):
BOOLEAN
effective function
{}
top
is_absolute_uri
(a_uri:
STRING
):
BOOLEAN
effective function
{}
top
True if
a_uri
contains a correctly formatted network URI (i.e. everything except the protocol scheme)
require
not a_uri.is_empty
notation
:
UNIX_DIRECTORY_NOTATION
once function
{}
top