Ignore:
Timestamp:
Mar 9, 2008, 12:00:01 PM (16 years ago)
Author:
イグトランス (egtra)
Message:

TextWriter, StreamWriterの追加。
SPrintfの浮動小数点数変換で、NaN, Infiniteの出力に対応。
PathとDirectoryInfoのCreateDirectoryで、対象が既に存在するときには例外を投げないように修正。
SimpleTestCase内で使用する一時フォルダの場所にGetTempPathで取得する版を追加(コメントアウト)。

File:
1 edited

Legend:

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

    r429 r468  
    8888    */
    8989    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
    9195    End Function
    9296
     
    172176    Static Function GetTempPath() As String
    173177        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))
    176181        If (len > size) or len = 0 Then
    177182            Throw New IOException("Path.GetTempPath: Failed to GetTempPath.")
    178183        Else
    179             Return New String(p, len As Long)
     184            buf.Length = len
     185            Return buf.ToString
    180186        End If
    181187    End Function
     
    209215    Static Const ExtensionSeparatorChar = &H2E As StrChar
    210216    Static Const InvalidPathChars = Ex"\q<>|\0\t" As String
    211     Static Const UniformNamingConventionString = Ex"\\\\" As String
     217    Static Const UniformNamingConventionString = "\\" As String
    212218
    213219    '----------------------------------------------------------------
     
    227233        Dim i As Long
    228234        For i = 0 To ELM(InvalidPathChars.Length)
    229             If path.Contains(InvalidPathChars.Substring(i, 1)) Then
     235            If path.Contains(InvalidPathChars[i]) Then
    230236                Throw New IOException("Path.CheckPath: The path contains invalidPathChars.")
    231237            End If
Note: See TracChangeset for help on using the changeset viewer.