Changeset 142 for Include/Classes/System/IO
- Timestamp:
- Mar 9, 2007, 10:15:34 PM (18 years ago)
- Location:
- Include/Classes/System/IO
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/Classes/System/IO/DirectoryInfo.ab
r129 r142 18 18 19 19 Function Root() As DirectoryInfo 20 Dim dirInfo as DirectoryInfo(Path.GetPathRoot(FullPath))20 Dim dirInfo As DirectoryInfo(Path.GetPathRoot(FullPath)) 21 21 Return dirInfo 22 22 End Function … … 24 24 'Public Method 25 25 Sub Create() 26 CreateDirectory( FullPath, NULL)26 CreateDirectory(ToTCStr(FullPath), NULL) 27 27 End Sub 28 28 … … 31 31 32 32 Override Sub Delete() 33 RemoveDirectory( FullPath)33 RemoveDirectory(ToTCStr(FullPath)) 34 34 End Sub 35 35 … … 54 54 /* Function GetFiles() As Array 55 55 End Function*/ 56 56 57 57 /* Function GetFiles(searchPattern As String) As Array 58 58 End Function*/ 59 59 60 60 /* Function GetFiles(searchPattern As String, searchOption As SearchOption) As Array 61 61 End Function*/ … … 68 68 69 69 Sub MoveTo(destDirName As String) 70 If MoveFile( FullPath, destDirName) = FalseThen70 If MoveFile(ToTCStr(FullPath), ToTCStr(destDirName)) = FALSE Then 71 71 'Exception 72 72 End If -
Include/Classes/System/IO/DriveInfo.ab
r64 r142 35 35 36 36 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 40 39 Return systemName 41 40 Else … … 48 47 End Function 49 48 50 Function IsReady() As B OOL49 Function IsReady() As Boolean 51 50 If GetVolumeInformation(m_DriveName, NULL, NULL, NULL, NULL, NULL, NULL, NULL) Then 52 Return _System_TRUE51 Return True 53 52 Else 54 Return _System_FALSE53 Return False 55 54 End If 56 55 End Function … … 82 81 83 82 Function VolumeLabel() As String 84 Dim volumeName As String 85 volumeName.ReSize(63) 83 Dim volumeName[63] As TCAHR 86 84 If GetVolumeInformation(m_DriveName, volumeName, 64, NULL, NULL, NULL, NULL, NULL) Then 87 85 Return volumeName -
Include/Classes/System/IO/FileSystemInfo.ab
r130 r142 167 167 Virtual Sub Refresh() 168 168 Dim data As WIN32_FIND_DATA 169 Dim hFind As HANDLE 170 hFind = FindFirstFile(FullPath, data) 169 Dim hFind = FindFirstFile(ToTCStr(FullPath), data) 171 170 FindClose(hFind) 172 171 … … 179 178 Private 180 179 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) 183 181 If hFile = INVALID_HANDLE_VALUE Then 184 182 setFileTime = False -
Include/Classes/System/IO/Path.ab
r136 r142 1 ' System/IO/Path.ab 2 3 #require <Classes/System/Environment.ab> 4 1 5 Class Path 2 6 Public … … 36 40 Return path.Remove(0, extPos) 37 41 End Function 38 42 39 43 Static Function ChangeExtension(path As String, extension As String) As String 40 44 Dim extPos As Long … … 49 53 Static Function HasExtension(ByRef path As String) As Boolean 50 54 If GetExtension(path) <> "" Then 51 Return _System_TRUE55 Return True 52 56 Else 53 Return _System_FALSE57 Return False 54 58 End If 55 59 End Function … … 74 78 75 79 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) 78 85 End Function 79 86 80 87 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 88 93 End Function 89 94 … … 108 113 End Function 109 114 110 Static Function IsPathRooted(path As String) As B OOL115 Static Function IsPathRooted(path As String) As Boolean 111 116 Dim volSepChar As String(Chr$(VolumeSeparatorChar)) 112 117 If path.IndexOf(volSepChar, 1, 1) = 1 Then 113 Return _System_TRUE118 Return True 114 119 Else 115 Return _System_FALSE120 Return False 116 121 End If 117 122 End Function
Note:
See TracChangeset
for help on using the changeset viewer.