indexing
description: "Path name abstraction"
library: "Free implementation of ELKS library"
copyright: "Copyright (c) 1986-2008, Eiffel Software and others"
license: "Eiffel Forum License v2 (see forum.txt)"
date: "$Date: 2008-05-23 17:24:07 -0700 (Fri, 23 May 2008) $"
revision: "$Revision: 170 $"
deferred class interface
PATH_NAME
feature
make
make_from_string (p: STRING_8)
`p'
require
path_not_void: p /= Void
ensure
valid_file_name: is_valid
feature
string: STRING_8
`Current'
STRING_8
ensure STRING_8
string_not_void: Result /= Void
string_type: Result.same_type (create {STRING_8}.make_empty)
first_item: count > 0 implies Result.item (1) = item (1)
recurse: count > 1 implies Result.substring (2, count).is_equal (substring (2, count).string)
feature
is_equal (other: like Current): BOOLEAN
`other'
require ANY
other_not_void: other /= Void
ensure ANY
symmetric: Result implies other.is_equal (Current)
consistent: standard_is_equal (other) implies Result
ensure then COMPARABLE
trichotomy: Result = (not (Current < other) and not (other < Current))
feature
is_directory_name_valid (dir_name: STRING_8): BOOLEAN
`dir_name'
require
exists: dir_name /= Void
is_empty: BOOLEAN
FINITE
require CONTAINER
True
require STRING_GENERAL
True
is_valid: BOOLEAN
is_volume_name_valid (vol_name: STRING_8): BOOLEAN
`vol_name'
require
exists: vol_name /= Void
prunable: BOOLEAN
STRING_8
feature
extend (directory_name: STRING_8)
`directory_name'
PATH_NAMEset_subdirectory
require
string_exists: directory_name /= Void
valid_directory_name: is_directory_name_valid (directory_name)
ensure
valid_file_name: is_valid
extend_from_array (directories: ARRAY [STRING_8])
`directories'
require
array_exists: directories /= Void and then not (directories.is_empty)
ensure
valid_file_name: is_valid
set_directory (directory_name: STRING_8)
`directory_name'
require
string_exists: directory_name /= Void
valid_directory_name: is_directory_name_valid (directory_name)
ensure
valid_file_name: is_valid
set_subdirectory (directory_name: STRING_8)
`directory_name'
PATH_NAMEextend
require
string_exists: directory_name /= Void
valid_directory_name: is_directory_name_valid (directory_name)
ensure
valid_file_name: is_valid
set_volume (volume_name: STRING_8)
`volume_name'
require
string_exists: volume_name /= Void
valid_volume_name: is_volume_name_valid (volume_name)
empty_path_name: is_empty
ensure
valid_file_name: is_valid
feature
wipe_out
STRING_8
require COLLECTION
prunable: prunable
ensure COLLECTION
wiped_out: is_empty
ensure then STRING_8
is_empty: count = 0
empty_capacity: capacity = 0
feature
frozen to_c: ANY
STRING_8
require STRING_8
not_is_dotnet: not {PLATFORM}.is_dotnet
feature
frozen twin: PATH_NAME
`Current'
twincopycopy
ANY
ensure ANY
twin_not_void: Result /= Void
is_equal: Result.is_equal (Current)
feature
out: STRING_8
STRING_8
require ANY
True
ensure ANY
out_not_void: Result /= Void
ensure then STRING_8
out_not_void: Result /= Void
same_items: same_type ("") implies Result.same_string (Current)
invariant
STRING_8
extendible: extendible
compare_character: not object_comparison
index_set_has_same_count: index_set.count = count
area_not_void: area /= Void
COMPARABLE
irreflexive_comparison: not (Current < Current)
ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
INDEXABLE
index_set_not_void: index_set /= Void
RESIZABLE
increase_by_at_least_one: minimal_increase >= 1
BOUNDED
valid_count: count <= capacity
full_definition: full = (count = capacity)
FINITE
empty_definition: is_empty = (count = 0)
non_negative_count: count >= 0
end PATH_NAME