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

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

Location:
Include/Classes/System/IO
Files:
4 edited

Legend:

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

    r129 r142  
    1818
    1919    Function Root() As DirectoryInfo
    20         Dim dirInfo as DirectoryInfo(Path.GetPathRoot(FullPath))
     20        Dim dirInfo As DirectoryInfo(Path.GetPathRoot(FullPath))
    2121        Return dirInfo
    2222    End Function
     
    2424    'Public Method
    2525    Sub Create()
    26         CreateDirectory(FullPath, NULL)
     26        CreateDirectory(ToTCStr(FullPath), NULL)
    2727    End Sub
    2828
     
    3131
    3232    Override Sub Delete()
    33         RemoveDirectory(FullPath)
     33        RemoveDirectory(ToTCStr(FullPath))
    3434    End Sub
    3535
     
    5454/*  Function GetFiles() As Array
    5555    End Function*/
    56    
     56
    5757/*  Function GetFiles(searchPattern As String) As Array
    5858    End Function*/
    59    
     59
    6060/*  Function GetFiles(searchPattern As String, searchOption As SearchOption) As Array
    6161    End Function*/
     
    6868
    6969    Sub MoveTo(destDirName As String)
    70         If MoveFile(FullPath, destDirName) = False Then
     70        If MoveFile(ToTCStr(FullPath), ToTCStr(destDirName)) = FALSE Then
    7171            'Exception
    7272        End If
  • Include/Classes/System/IO/DriveInfo.ab

    r64 r142  
    3535
    3636    Function DriveFormat() As String
    37         Dim systemName As String
    38         systemName.ReSize(15)
    39         If GetVolumeInformation(m_DriveName, NULL, NULL, NULL, NULL, NULL, systemName, 16) Then
     37        Dim systemName[15] As TCHAR
     38        If GetVolumeInformation(m_DriveName, NULL, NULL, NULL, NULL, NULL, systemName, Len (systemName)) Then
    4039            Return systemName
    4140        Else
     
    4847    End Function
    4948
    50     Function IsReady() As BOOL
     49    Function IsReady() As Boolean
    5150        If GetVolumeInformation(m_DriveName, NULL, NULL, NULL, NULL, NULL, NULL, NULL) Then
    52             Return _System_TRUE
     51            Return True
    5352        Else
    54             Return _System_FALSE
     53            Return False
    5554        End If
    5655    End Function
     
    8281
    8382    Function VolumeLabel() As String
    84         Dim volumeName As String
    85         volumeName.ReSize(63)
     83        Dim volumeName[63] As TCAHR
    8684        If GetVolumeInformation(m_DriveName, volumeName, 64, NULL, NULL, NULL, NULL, NULL) Then
    8785            Return volumeName
  • Include/Classes/System/IO/FileSystemInfo.ab

    r130 r142  
    167167    Virtual Sub Refresh()
    168168        Dim data As WIN32_FIND_DATA
    169         Dim hFind As HANDLE
    170         hFind = FindFirstFile(FullPath, data)
     169        Dim hFind = FindFirstFile(ToTCStr(FullPath), data)
    171170        FindClose(hFind)
    172171
     
    179178Private
    180179    Function setFileTime() As Boolean
    181         Dim hFile As HANDLE
    182         hFile = CreateFile(FullPath, GENERIC_WRITE, FILE_SHARE_READ Or FILE_SHARE_WRITE, ByVal 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0)
     180        Dim hFile = CreateFile(ToTCStr(FullPath), GENERIC_WRITE, FILE_SHARE_READ Or FILE_SHARE_WRITE, ByVal 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0)
    183181        If hFile = INVALID_HANDLE_VALUE Then
    184182            setFileTime = False
  • 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.