2911
|
1 |
'From Smalltalk/X, Version:3.1.9 on 9-sep-1997 at 11:55:53 pm' !
|
2907
|
2 |
|
|
3 |
Filename subclass:#PCFilename
|
|
4 |
instanceVariableNames:''
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'OS-PC'
|
|
8 |
!
|
|
9 |
|
2911
|
10 |
!PCFilename class methodsFor:'documentation'!
|
|
11 |
|
2925
|
12 |
copyright
|
|
13 |
"
|
|
14 |
COPYRIGHT (c) 1997 by eXept Software AG
|
|
15 |
All Rights Reserved
|
|
16 |
|
|
17 |
This software is furnished under a license and may be used
|
|
18 |
only in accordance with the terms of that license and with the
|
|
19 |
inclusion of the above copyright notice. This software may not
|
|
20 |
be provided or otherwise made available to, or used by, any
|
|
21 |
other person. No title to or ownership of the software is
|
|
22 |
hereby transferred.
|
|
23 |
"
|
|
24 |
!
|
|
25 |
|
2911
|
26 |
documentation
|
|
27 |
"
|
|
28 |
Filenames in Windows-NT / Win95.
|
|
29 |
"
|
|
30 |
! !
|
|
31 |
|
2907
|
32 |
!PCFilename class methodsFor:'queries'!
|
|
33 |
|
|
34 |
isBadCharacter:aCharacter
|
|
35 |
"return true, if aCharacter is unallowed in a filename."
|
|
36 |
|
|
37 |
('<>:"/\|' includes:aCharacter) ifTrue:[^ true].
|
|
38 |
^ super isBadCharacter:aCharacter
|
|
39 |
|
|
40 |
"Created: 8.9.1997 / 00:14:06 / cg"
|
|
41 |
!
|
|
42 |
|
2908
|
43 |
isCaseSensitive
|
|
44 |
"return true, if filenames are case sensitive."
|
|
45 |
|
|
46 |
^ false
|
|
47 |
!
|
|
48 |
|
2907
|
49 |
separator
|
|
50 |
"return the file/directory separator."
|
|
51 |
|
|
52 |
^ $\
|
|
53 |
|
|
54 |
"
|
|
55 |
Filename concreteClass separator
|
|
56 |
"
|
|
57 |
|
|
58 |
"Modified: 8.9.1997 / 00:18:03 / cg"
|
|
59 |
! !
|
|
60 |
|
|
61 |
!PCFilename methodsFor:'queries'!
|
|
62 |
|
2925
|
63 |
isExplicitRelative
|
|
64 |
"return true, if this name is an explicit relative name
|
|
65 |
(i.e. starts with './' or '../', to avoid path-prepending)"
|
|
66 |
|
|
67 |
(nameString startsWith:'.\') ifTrue:[
|
|
68 |
^ true
|
|
69 |
].
|
|
70 |
(nameString startsWith:'..\') ifTrue:[
|
|
71 |
^ true
|
|
72 |
].
|
|
73 |
^ false
|
|
74 |
!
|
|
75 |
|
2907
|
76 |
isVolumeAbsolute
|
|
77 |
"return true, if the receiver represents an absolute pathname
|
|
78 |
on some disk volume."
|
|
79 |
|
3019
|
80 |
^ ((nameString size >= 2) and:[(nameString at:2) == $:])
|
2907
|
81 |
|
|
82 |
"Created: 7.9.1997 / 23:54:20 / cg"
|
|
83 |
!
|
|
84 |
|
2925
|
85 |
localNameStringFrom:aString
|
|
86 |
"ST-80 compatibility.
|
|
87 |
what does this do ? (used in FileNavigator-goody).
|
|
88 |
GUESS: does it strip off the voulume-character and initial '\' ?"
|
|
89 |
|
|
90 |
(aString at:2) == $: ifTrue:[
|
|
91 |
(aString at:3) == $\ ifTrue:[
|
|
92 |
^ aString copyFrom:4
|
|
93 |
].
|
|
94 |
^ aString copyFrom:3
|
|
95 |
].
|
|
96 |
(aString at:1) == $\ ifTrue:[
|
|
97 |
^ aString copyFrom:1
|
|
98 |
].
|
|
99 |
^ aString
|
|
100 |
!
|
|
101 |
|
2907
|
102 |
volume
|
|
103 |
"return the disc volume part of the name or an empty string.
|
|
104 |
This is only used with DOS filenames - on unix, an empty string is returned"
|
|
105 |
|
|
106 |
(nameString at:2) == $: ifTrue:[
|
|
107 |
^ nameString copyTo:1
|
|
108 |
].
|
|
109 |
^ ''
|
|
110 |
|
|
111 |
"Created: 7.9.1997 / 23:58:06 / cg"
|
|
112 |
! !
|
|
113 |
|
2911
|
114 |
!PCFilename class methodsFor:'documentation'!
|
|
115 |
|
|
116 |
version
|
3019
|
117 |
^ '$Header: /cvs/stx/stx/libbasic/PCFilename.st,v 1.5 1997-10-10 21:02:12 cg Exp $'
|
2911
|
118 |
! !
|