Changeset 468 for trunk/Include/Classes/System/IO/Path.ab
- Timestamp:
- Mar 9, 2008, 12:00:01 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/Classes/System/IO/Path.ab
r429 r468 88 88 */ 89 89 Static Function GetFullPath(path As String) As String 90 Return Combine(System.Environment.CurrentDirectory, path) 90 If IsPathRooted(path) Then 91 Return path 92 Else 93 Return Combine(System.Environment.CurrentDirectory, path) 94 End If 91 95 End Function 92 96 … … 172 176 Static Function GetTempPath() As String 173 177 Dim size = WIN32API_GetTempPath(0, 0) 174 Dim p = GC_malloc_atomic(SizeOf (TCHAR) * size) As PCTSTR 175 Dim len = WIN32API_GetTempPath(size, p) 178 Dim buf = New Text.StringBuilder(size) 179 buf.Length = size 180 Dim len = WIN32API_GetTempPath(size, StrPtr(buf)) 176 181 If (len > size) or len = 0 Then 177 182 Throw New IOException("Path.GetTempPath: Failed to GetTempPath.") 178 183 Else 179 Return New String(p, len As Long) 184 buf.Length = len 185 Return buf.ToString 180 186 End If 181 187 End Function … … 209 215 Static Const ExtensionSeparatorChar = &H2E As StrChar 210 216 Static Const InvalidPathChars = Ex"\q<>|\0\t" As String 211 Static Const UniformNamingConventionString = Ex"\\\\" As String217 Static Const UniformNamingConventionString = "\\" As String 212 218 213 219 '---------------------------------------------------------------- … … 227 233 Dim i As Long 228 234 For i = 0 To ELM(InvalidPathChars.Length) 229 If path.Contains(InvalidPathChars .Substring(i, 1)) Then235 If path.Contains(InvalidPathChars[i]) Then 230 236 Throw New IOException("Path.CheckPath: The path contains invalidPathChars.") 231 237 End If
Note:
See TracChangeset
for help on using the changeset viewer.