Changeset 125 for Include/Classes


Ignore:
Timestamp:
Mar 2, 2007, 2:57:09 PM (18 years ago)
Author:
イグトランス (egtra)
Message:

#51完了

Location:
Include/Classes/System
Files:
2 edited

Legend:

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

    r62 r125  
    11Class Path
    22Public
    3     Static AltDirectorySeparatorChar = &H2F As Byte '/
    4     Static DirectorySeparatorChar = &H5C As Byte    '\
    5     Static PathSeparator = &H3B As Byte             ';
    6     Static VolumeSeparatorChar = &H3A As Byte       ':
     3    Static AltDirectorySeparatorChar = &H2F As Char '/
     4    Static DirectorySeparatorChar = &H5C As Char    '\
     5    Static PathSeparator = &H3B As Char             ';
     6    Static VolumeSeparatorChar = &H3A As Char       ':
    77
    88    Static Function GetFileName(path As String) As String
     
    5050    End Function
    5151
    52     Static Function HasExtension(ByRef path As String) As BOOL
     52    Static Function HasExtension(ByRef path As String) As Boolean
    5353        If GetExtension(path) <> "" Then
    5454            Return _System_TRUE
     
    5959
    6060    Static Function GetTempFileName() As String
    61         ' TODO: 実装
     61        Dim tempPathSize = __GetTempPath(0, 0)
     62        Dim tempPath = _System_malloc(SizeOf (TCHAR) * tempPathSize) As PTSTR
     63        If tempPath = 0 Then
     64            ' Throw OutOfMemoryException
     65            Debug
     66        End If
     67        If __GetTempPath(tempPathSize, tempPath) > tempPathSize Then
     68            ' Throw IOException?
     69            Debug
     70        End If
     71
     72        Dim tempFileName[ELM(MAX_PATH)] As TCHAR
     73        __GetTempFileName(tempPath, "ABT", 0, tempFileName)
     74        free(tempPath)
     75        Return tempFileName
    6276    End Function
    6377
     
    148162    Return GetTempPath(nBufferLength, lpBuffer)
    149163End Function
     164
     165Function __GetTempFileName(pPathName As PCSTR, pPrefixString As PCSTR, uUnique As DWord, pTempFileName As PSTR) As DWord
     166    Return GetTempFileName(pPathName, pPrefixString, uUnique, pTempFileName)
     167End Function
  • Include/Classes/System/String.ab

    r123 r125  
    1212        String()
    1313        Assign(initStr)
     14    End Sub
     15
     16    Sub String(initStr As *Char, length As Long)
     17        String()
     18        Assign(initStr, length)
    1419    End Sub
    1520
     
    454459
    455460    Sub ToLower()
    456         CharLower(Chars)
     461        Dim i As Long
     462        For i = 0 To m_Length
     463            Chars[i] = _System_ASCII_ToLower(Chars[i])
     464        Next
    457465    End Sub
    458466
    459467    Sub ToUpper()
    460         CharUpper(Chars)
     468        Dim i As Long
     469        For i = 0 To m_Length
     470            Chars[i] = _System_ASCII_ToUpper(Chars[i])
     471        Next
    461472    End Sub
    462473
Note: See TracChangeset for help on using the changeset viewer.