Ignore:
Timestamp:
Mar 9, 2007, 10:15:34 PM (17 years ago)
Author:
イグトランス (egtra)
Message:

Environment, OperatingSystem, Versionの追加、Unicode対応修正ほか

File:
1 edited

Legend:

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

    r136 r142  
     1' System/IO/Path.ab
     2
     3#require <Classes/System/Environment.ab>
     4
    15Class Path
    26Public
     
    3640        Return path.Remove(0, extPos)
    3741    End Function
    38    
     42
    3943    Static Function ChangeExtension(path As String, extension As String) As String
    4044        Dim extPos As Long
     
    4953    Static Function HasExtension(ByRef path As String) As Boolean
    5054        If GetExtension(path) <> "" Then
    51             Return _System_TRUE
     55            Return True
    5256        Else
    53             Return _System_FALSE
     57            Return False
    5458        End If
    5559    End Function
     
    7478
    7579    Static Function GetTempPath() As String
    76         GetTempPath.ReSize(__GetTempPath(0, 0) - 1)
    77         __GetTempPath(GetTempPath.Length + 1, GetTempPath)
     80        Dim size = GetTempPath(0, 0
     81        Dim tempPath = _System_malloc(size))
     82        __GetTempPath(size, tempPath)
     83        GetTempPath = tempPath
     84        _System_free(tempPath)
    7885    End Function
    7986
    8087    Static Function GetFullPath(path As String) As String
    81         Dim cd As String
    82         Dim dirSepChar As String(Chr$(DirectorySeparatorChar))
    83         If IsPathRooted(path) Then Return path
    84 
    85         cd.ReSize = GetCurrentDirectory(0, 0) - 1
    86         GetCurrentDirectory(cd.Length + 1, cd)
    87         Return cd + dirSepChar + path
     88        If IsPathRooted(path) Then
     89            Return path
     90        Else
     91            Return Environment.CurrentDirectory + Chr$(DirectorySeparatorChar) + path
     92        End If
    8893    End Function
    8994
     
    108113    End Function
    109114
    110     Static Function IsPathRooted(path As String) As BOOL
     115    Static Function IsPathRooted(path As String) As Boolean
    111116        Dim volSepChar As String(Chr$(VolumeSeparatorChar))
    112117        If path.IndexOf(volSepChar, 1, 1) = 1 Then
    113             Return _System_TRUE
     118            Return True
    114119        Else
    115             Return _System_FALSE
     120            Return False
    116121        End If
    117122    End Function
Note: See TracChangeset for help on using the changeset viewer.