Changeset 388 for trunk/Include/Classes/System/IO/Path.ab
- Timestamp:
- Nov 25, 2007, 4:31:35 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/Classes/System/IO/Path.ab
r296 r388 10 10 Class Path 11 11 Public 12 Static AltDirectorySeparatorChar = &H2F As Char '/13 Static DirectorySeparatorChar = &H5C As Char '\14 Static PathSeparator = &H3B As Char ';15 Static VolumeSeparatorChar = &H3A As Char ':12 Static AltDirectorySeparatorChar = &H2F As StrChar '/ 13 Static DirectorySeparatorChar = &H5C As StrChar '\ 14 Static PathSeparator = &H3B As StrChar '; 15 Static VolumeSeparatorChar = &H3A As StrChar ': 16 16 17 17 Static Function GetFileName(path As String) As String … … 121 121 122 122 Static Function Combine(path1 As String, path2 As String) As String 123 If path1.LastIndexOf( Chr$(VolumeSeparatorChar)) And path1.Length = 2 Then123 If path1.LastIndexOf(VolumeSeparatorChar) And path1.Length = 2 Then 124 124 Return path1 + path2 125 125 End If 126 126 127 If path1.LastIndexOf( Chr$(DirectorySeparatorChar), ELM(path1.Length), 1) = -1 Then127 If path1.LastIndexOf(DirectorySeparatorChar, ELM(path1.Length), 1) = -1 Then 128 128 Return path1 + Chr$(DirectorySeparatorChar) + path2 129 129 Else … … 133 133 134 134 Private 135 Static Function getExtensionPosition( ByRefpath As String) As Long135 Static Function getExtensionPosition(path As String) As Long 136 136 Dim lastSepPos = getLastSeparatorPosision(path) As Long 137 getExtensionPosition = path.LastIndexOf(".", ELM(path.Length), path.Length - lastSepPos) 137 If lastSepPos = -1 Then 138 lastSepPos = 0 139 End If 140 getExtensionPosition = path.LastIndexOf(Asc("."), ELM(path.Length), path.Length - lastSepPos) 138 141 End Function 139 142 140 Static Function getLastSeparatorPosision( ByRefpath As String) As Long141 Dim lastSepPos = path.LastIndexOf( Chr$(DirectorySeparatorChar)) As Long143 Static Function getLastSeparatorPosision(path As String) As Long 144 Dim lastSepPos = path.LastIndexOf(DirectorySeparatorChar) As Long 142 145 If lastSepPos <> -1 Then Return lastSepPos 143 146 144 lastSepPos = path.LastIndexOf( Chr$(VolumeSeparatorChar))147 lastSepPos = path.LastIndexOf(VolumeSeparatorChar) 145 148 Return lastSepPos 146 149 End Function
Note:
See TracChangeset
for help on using the changeset viewer.