Changeset 469


Ignore:
Timestamp:
Mar 10, 2008, 10:54:32 AM (16 years ago)
Author:
OverTaker
Message:

Path.CheckPath()で、ディレクトリ区切り文字が連続した場合、例外を投げるのではなく、ひとつに置き換えるようにした。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Include/Classes/System/IO/Path.ab

    r468 r469  
    8888    */
    8989    Static Function GetFullPath(path As String) As String
     90        path = CheckPath(path)
    9091        If IsPathRooted(path) Then
    9192            Return path
     
    207208    Static Function IsPathRooted(path As String) As Boolean
    208209        path = CheckPath(path)
    209         Return path.Contains(UniformNamingConventionString) _
     210        Return path.StartsWith(UniformNamingConventionString) _
    210211            or path.Contains(VolumeSeparatorChar) _
    211212            or path.StartsWith(DirectorySeparatorChar)
     
    238239        Next
    239240
    240         If path.LastIndexOf(UniformNamingConventionString) > 0 Then
    241             Throw New IOException("Path.CheckPath: The path is invalid value.")
    242         End If
     241        Dim continuousIndex = path.IndexOf("\\", 1)
     242        While continuousIndex <> -1
     243            path = path.Remove(continuousIndex, 1)
     244            continuousIndex = path.IndexOf("\\", continuousIndex)
     245        Wend
    243246
    244247        If path.EndsWith(DirectorySeparatorChar) Then
Note: See TracChangeset for help on using the changeset viewer.