home
wiki
classes/clusters list
class information
+
Point of view
ANY
ANY
MICROSOFT_PATH_NAME
INTERNALS_HANDLER
All features
class MICROSOFT_PATH_NAME
Summary
top
Operating system path name, Microsoft notation (DOS, Win9x, WinNT)
Direct parents
inherit list:
PATH_NAME
Overview
top
creation features
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
)
copy
(other: MICROSOFT_PATH_NAME)
Update current object using fields of object attached to
other
, so as to yield equal objects.
exported features
Creation
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
drive_separator
:
CHARACTER
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
last
:
STRING
Last component (also known as
"basename"
)
extension
:
STRING
Path extension (may be empty)
is_absolute
:
BOOLEAN
absolute path?
is_normalized
:
BOOLEAN
Has no redundant separators, or redundant up-references
exists
:
BOOLEAN
local i: FILE_INFORMATION
same_file
(other: MICROSOFT_PATH_NAME):
BOOLEAN
local i, j: FILE_INFORMATION
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: MICROSOFT_PATH_NAME)
Join with
other
using filesystem semantics
expand_user
Replace an initial
"~"
or
"~user"
by user home directory
expand_shellouts
Replace substrings of form $(command) with execution of shell commands
Copying, comparison
copy
(other: MICROSOFT_PATH_NAME)
Update current object using fields of object attached to
other
, so as to yield equal objects.
is_equal
(other: MICROSOFT_PATH_NAME):
BOOLEAN
Is
other
attached to an object considered equal to current object?
Access
is_empty
:
BOOLEAN
Path is null.
as_absolute
: MICROSOFT_PATH_NAME
Equivalent absolute path
is_file
:
BOOLEAN
Path points to an existing regular file?
is_directory
:
BOOLEAN
Path points to an existing directory?
infix "+"
(other: MICROSOFT_PATH_NAME): MICROSOFT_PATH_NAME
Join with
other
using filesystem semantics
infix "/"
(elem:
STRING
): MICROSOFT_PATH_NAME
Path with
elem
inside current
Operations
expand_variables
Replace substrings of form $name or ${name} with environment variable values
make_empty
top
Make a 'null' path
ensure
is_empty
make_root
top
Path to root directory (in current drive)
ensure
to_string
.is_equal("\")
is_absolute
make_current
top
Path to current directory (relative).
See also
to_absolute
if you need the absolute current working directory
ensure
to_string
.is_equal(".")
not is_absolute
make_from_string
(s:
STRING
)
top
ensure
to_string.is_equal(s)
extension_separator
:
CHARACTER
attribute
top
Character used to separate filenames from extensions
directory_separator
:
CHARACTER
attribute
top
Character used to separate directories This character is forbidden in filenames
drive_separator
:
CHARACTER
attribute
top
to_string
:
STRING
top
String representation
ensure
Result /= Void
drive_specification
:
STRING
top
Drive specified by the current path, Void if none
ensure
Result.count = 0 or Result.count = 2
not Result.is_empty implies Result.item(2) = ':'
Result /= Void implies to_string.has_prefix(Result)
count
:
INTEGER_32
top
Number of elements in_path
ensure
Result >= 0
last
:
STRING
top
Last component (also known as
"basename"
)
require
not is_empty
ensure
to_string
.has_suffix(Result)
Result /= Void
not Result.has(directory_separator)
extension
:
STRING
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
top
absolute path?
is_normalized
:
BOOLEAN
top
Has no redundant separators, or redundant up-references
ensure
Result implies not
to_string
.has_substring("\.\")
Result implies not
to_string
.has_suffix("\.")
Result implies not
to_string
.is_empty
exists
:
BOOLEAN
top
local i: FILE_INFORMATION
same_file
(other: MICROSOFT_PATH_NAME):
BOOLEAN
top
local i, j: FILE_INFORMATION
to_absolute
top
Transform into equivalent absolute path
ensure
is_absolute
is_normalized
normalize_case
top
Transform into normalized case version (equivalent), with standard path separators
normalize
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
top
Remove last component of path (keep the
"dirname"
)
require
not is_empty
ensure
old
to_string
.twin.has_prefix(
to_string
)
count = old count - 1
add_last
(elem:
STRING
)
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: MICROSOFT_PATH_NAME)
top
Join with
other
using filesystem semantics
require
other /= Void
expand_user
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_shellouts
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)
copy
(other: MICROSOFT_PATH_NAME)
top
Update current object using fields of object attached to
other
, so as to yield equal objects.
Note: you can't copy object from a different dynamic type.
require
same_dynamic_type(other)
ensure
is_equal(other)
is_equal
(other: MICROSOFT_PATH_NAME):
BOOLEAN
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_empty
:
BOOLEAN
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
as_absolute
: MICROSOFT_PATH_NAME
top
Equivalent absolute path
ensure
Result.
is_absolute
Result.
is_normalized
is_file
:
BOOLEAN
top
Path points to an existing regular file?
is_directory
:
BOOLEAN
top
Path points to an existing directory?
infix "+"
(other: MICROSOFT_PATH_NAME): MICROSOFT_PATH_NAME
top
Join with
other
using filesystem semantics
require
other /= Void
infix "/"
(elem:
STRING
): MICROSOFT_PATH_NAME
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)
expand_variables
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)