home
wiki
classes/clusters list
class information
+
Point of view
INTERNALS_HANDLER
ANY
INTERNALS_HANDLER
All features
deferred class PATH_NAME
Summary
top
Operating system path name
Direct parents
inherit list:
ANY
Known children
inherit list:
MICROSOFT_PATH_NAME
,
POSIX_PATH_NAME
Overview
top
exported features
Creation/ Initialization
make_empty
Make a 'null' path
make_root
Path to root directory (in current drive)
make_current
Path to current directory (relative).
make_from_string
(s:
STRING
)
Constants
extension_separator
:
CHARACTER
Character used to separate filenames from extensions
directory_separator
:
CHARACTER
Character used to separate directories This character is forbidden in filenames
Access
to_string
:
STRING
String representation
drive_specification
:
STRING
Drive specified by the current path, Void if none
count
:
INTEGER_32
Number of elements in_path
is_empty
:
BOOLEAN
Path is null.
last
:
STRING
Last component (also known as
"basename"
)
extension
:
STRING
Path extension (may be empty)
is_absolute
:
BOOLEAN
absolute path?
as_absolute
: PATH_NAME
Equivalent absolute path
is_normalized
:
BOOLEAN
Has no redundant separators, or redundant up-references
is_file
:
BOOLEAN
Path points to an existing regular file?
is_directory
:
BOOLEAN
Path points to an existing directory?
infix "+"
(other: PATH_NAME): PATH_NAME
Join with
other
using filesystem semantics
infix "/"
(elem:
STRING
): PATH_NAME
Path with
elem
inside current
Operations
to_absolute
Transform into equivalent absolute path
normalize_case
Transform into normalized case version (equivalent), with standard path separators
normalize
Normalize removing double separators, and up-references
remove_last
Remove last component of path (keep the
"dirname"
)
add_last
(elem:
STRING
)
join
(other: PATH_NAME)
Join with
other
using filesystem semantics
expand_user
Replace an initial
"~"
or
"~user"
by user home directory
expand_variables
Replace substrings of form $name or ${name} with environment variable values
expand_shellouts
Replace substrings of form $(command) with execution of shell commands
make_empty
deferred procedure
top
Make a 'null' path
ensure
is_empty
make_root
deferred procedure
top
Path to root directory (in current drive)
ensure
is_absolute
make_current
deferred procedure
top
Path to current directory (relative).
See also
to_absolute
if you need the absolute current working directory
ensure
not
is_absolute
make_from_string
(s:
STRING
)
deferred procedure
top
ensure
to_string
.is_equal(s)
extension_separator
:
CHARACTER
deferred function
top
Character used to separate filenames from extensions
directory_separator
:
CHARACTER
deferred function
top
Character used to separate directories This character is forbidden in filenames
to_string
:
STRING
deferred function
top
String representation
ensure
Result /= Void
drive_specification
:
STRING
deferred function
top
Drive specified by the current path, Void if none
ensure
Result /= Void implies
to_string
.has_prefix(Result)
count
:
INTEGER_32
deferred function
top
Number of elements in_path
ensure
Result >= 0
is_empty
:
BOOLEAN
effective function
top
Path is null.
Note that you can have a null absolute path (i.e., root) or a null relative path (current directory)
ensure
Result =
count
= 0
last
:
STRING
deferred function
top
Last component (also known as
"basename"
)
require
not
is_empty
ensure
Result /= Void
not Result.has(
directory_separator
)
extension
:
STRING
deferred function
top
Path extension (may be empty)
ensure
is_suffix:
to_string
.has_suffix(Result)
is_extension:
not Result.is_empty implies Result.first =
extension_separator
is_minimal:
Result.occurrences(
extension_separator
) <= 1
not Result.has(
directory_separator
)
is_empty
implies Result.is_empty
is_absolute
:
BOOLEAN
deferred function
top
absolute path?
as_absolute
: PATH_NAME
effective function
top
Equivalent absolute path
ensure
Result.
is_absolute
Result.
is_normalized
is_normalized
:
BOOLEAN
deferred function
top
Has no redundant separators, or redundant up-references
is_file
:
BOOLEAN
effective function
top
Path points to an existing regular file?
is_directory
:
BOOLEAN
effective function
top
Path points to an existing directory?
infix "+"
(other: PATH_NAME): PATH_NAME
effective function
top
Join with
other
using filesystem semantics
require
other /= Void
infix "/"
(elem:
STRING
): PATH_NAME
effective function
top
Path with
elem
inside current
require
elem /= Void
not elem.has(
directory_separator
)
ensure
Result.
is_empty
=
is_empty
and elem.is_empty
Result.
last
.is_equal(elem)
to_absolute
deferred procedure
top
Transform into equivalent absolute path
ensure
is_absolute
is_normalized
normalize_case
deferred procedure
top
Transform into normalized case version (equivalent), with standard path separators
normalize
deferred procedure
top
Normalize removing double separators, and up-references
ensure
is_normalized
old
is_normalized
implies
to_string
.is_equal(old
to_string
.twin)
remove_last
deferred procedure
top
Remove last component of path (keep the
"dirname"
)
require
not
is_empty
ensure
count
= old
count
- 1
add_last
(elem:
STRING
)
deferred procedure
top
require
elem /= Void
not elem.has(
directory_separator
)
ensure
last
.is_equal(elem)
not_reduced:
old
count
<=
count
may_grow_one:
count
<= old
count
+ 1
join
(other: PATH_NAME)
deferred procedure
top
Join with
other
using filesystem semantics
require
other /= Void
expand_user
deferred procedure
top
Replace an initial
"~"
or
"~user"
by user home directory
ensure
not old
to_string
.twin.has_prefix("~") implies
to_string
.is_equal(old
to_string
.twin)
expand_variables
effective procedure
top
Replace substrings of form $name or ${name} with environment variable values
ensure
not old
to_string
.twin.has('$') implies
to_string
.is_equal(old
to_string
.twin)
expand_shellouts
deferred procedure
top
Replace substrings of form $(command) with execution of shell commands
ensure
not
to_string
.has_substring("$(") implies
to_string
.is_equal(old
to_string
.twin)