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

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

Location:
trunk/Include/Classes/System
Files:
1 added
9 edited

Legend:

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

    r409 r468  
    5959            Select Case error
    6060                Case ERROR_ALREADY_EXISTS
    61                     Throw New IOException("DirectoryInfo.CreateDirectory: The directory has already existed.")
     61                    Exit Sub 'ディレクトリが既に存在するときは、何もしない。
    6262                Case Else
    6363                    Throw New IOException("DirectoryInfo.CreateDirectory: Failed to CreateDirectory")
  • 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
  • trunk/Include/Classes/System/IO/Stream.ab

    r432 r468  
    77
    88Public 'Protected
    9     Sub Stream():   End Sub
     9    Sub Stream()
     10    End Sub
    1011Public
    1112    Virtual Sub ~Stream()
     
    5455        Dispose(True)
    5556    End Sub
    56     Virtual Function EndRead(ByRef asyncResult As System.IAsyncResult) As Long: End Function
    57     Virtual Sub EndWrite(ByRef asyncResult As System.IAsyncResult): End Sub
     57    Virtual Function EndRead(ByRef asyncResult As System.IAsyncResult) As Long
     58    End Function
     59    Virtual Sub EndWrite(ByRef asyncResult As System.IAsyncResult)
     60    End Sub
    5861    Abstract Sub Flush()
    5962    Abstract Function Read(buffer As *Byte, offset As Long, count As Long) As Long
     
    7275    Abstract Sub SetLength(value As Int64)
    7376    Abstract Sub Write(buffer As *Byte, offset As Long, count As Long)
    74 
    7577    Virtual Sub WriteByte(b As Byte)
    7678        Write(VarPtr(b), 0, 1)
  • trunk/Include/Classes/System/IO/StreamWriter.ab

    r271 r468  
    44   
    55Class StreamWriter
    6     ' TODO: 実装
     6    Inherits TextWriter
     7Public
     8    /*
     9    @date 2008/02/25
     10    @auther Egtra
     11    */
     12    Sub StreamWriter(path As String)
     13        init(New FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None))
     14    End Sub
     15
     16    /*
     17    @date 2008/02/25
     18    @auther Egtra
     19    */
     20    Sub StreamWriter(stream As Stream)
     21        init(stream)
     22    End Sub
     23
     24    Override Sub Write(str As String)
     25        buf.Append(str)
     26        Dim len = buf.Length
     27        If len >= 2048 Then
     28            s.Write(StrPtr(buf) As *Byte, 0, len)
     29            buf.Length = 0
     30        End If
     31    End Sub
     32
     33    Override Sub Write(x As Boolean)
     34        buf.Append(x)
     35    End Sub
     36   
     37    Override Sub Write(x As Char)
     38        buf.Append(x)
     39    End Sub
     40
     41    Override Sub Write(x As Byte)
     42        buf.Append(x)
     43    End Sub
     44#ifdef UNICODE
     45    Override Sub Write(x As SByte)
     46        buf.Append(x)
     47    End Sub
     48#else
     49    Override Sub Write(x As Word)
     50        buf.Append(x)
     51    End Sub
     52#endif
     53    Override Sub Write(x As Integer)
     54        buf.Append(x)
     55    End Sub
     56
     57    Override Sub Write(x As DWord)
     58        buf.Append(x)
     59    End Sub
     60
     61    Override Sub Write(x As Long)
     62        buf.Append(x)
     63    End Sub
     64
     65    Override Sub Write(x As QWord)
     66        buf.Append(x)
     67    End Sub
     68
     69    Override Sub Write(x As Int64)
     70        buf.Append(x)
     71    End Sub
     72
     73    Override Sub Write(x As Single)
     74        buf.Append(x)
     75    End Sub
     76
     77    Override Sub Write(x As Double)
     78        buf.Append(x)
     79    End Sub
     80
     81    Override Sub Write(x As Object)
     82        Write(x.ToString)
     83    End Sub
     84
     85Protected
     86    Override Sub Dispose(disposing As Boolean)
     87        If disposing Then
     88            s.Dispose()
     89        End If
     90    End Sub
     91
     92Private
     93    Sub init(stream As Stream)
     94        s = stream
     95        buf = New System.Text.StringBuilder(4096)
     96    End Sub
     97
     98    buf As Text.StringBuilder
     99    s As System.IO.Stream
    7100End Class
    8101
  • trunk/Include/Classes/System/IO/TextReader.ab

    r457 r468  
    101101
    102102Protected
    103     Abstract Sub Dispose(disposing As Boolean)
     103    Virtual Sub Dispose(disposing As Boolean)
     104    End Sub
    104105
    105106    /*
  • trunk/Include/Classes/System/String.ab

    r457 r468  
    55#require <Classes/ActiveBasic/Strings/Strings.ab>
    66
    7 #ifdef __STRING_IS_NOT_ALWAYS_UNICODE
    8 
    9 #ifndef UNICODE
    107TypeDef StrChar = Char
    11 #define __STRING_IS_NOT_UNICODE
    12 #endif
    13 
    14 #endif
    15 
    16 #ifndef __STRING_IS_NOT_UNICODE
    17 TypeDef StrChar = WCHAR
    188
    199#ifdef UNICODE
    2010#define __STRING_IS_UNICODE
    2111#else
    22 #define __STRING_UNICODE_WINDOWS_ANSI
     12#define __STRING_IS_NOT_UNICODE
    2313#endif
    24 #endif
    2514
    2615Namespace System
    2716
    2817    Class String
    29         Implements /*IComparable, ICloneable, IConvertible, IComparable<String>, IEnumerable, IEnumerable<StrChar>, IEquatable<String>*/
     18        Implements /*IComparable, ICloneable, IConvertible, IComparable<String>, IEnumerable, IEnumerable<Char>, IEquatable<String>*/
    3019
    3120        m_Length As Long
    32         Chars As *StrChar
     21        Chars As *Char
    3322
    3423        Sub validPointerCheck(p As VoidPtr, size = 1 As Long)
     
    8978        End Sub
    9079
    91         Sub String(initChar As StrChar, length As Long)
     80        Sub String(initChar As Char, length As Long)
    9281            AllocStringBuffer(length)
    9382            ActiveBasic.Strings.ChrFill(Chars, length, initChar)
     
    10594        End Function
    10695
    107         Function Operator() As *StrChar
     96        Function Operator() As *Char
    10897            Return Chars
    10998        End Function
    11099
    111         Const Function Operator [] (n As Long) As StrChar
     100        Const Function Operator [] (n As Long) As Char
    112101            rangeCheck(n)
    113102            Return Chars[n]
     
    154143        End Function
    155144
    156         Const Function Operator == (y As *StrChar) As Boolean
     145        Const Function Operator == (y As *Char) As Boolean
    157146            Return Compare(This, y) = 0
    158147        End Function
     
    162151        End Function
    163152
    164         Const Function Operator <> (y As *StrChar) As Boolean
     153        Const Function Operator <> (y As *Char) As Boolean
    165154            Return Compare(This, y) <> 0
    166155        End Function
     
    170159        End Function
    171160
    172         Const Function Operator < (y As *StrChar) As Boolean
     161        Const Function Operator < (y As *Char) As Boolean
    173162            Return Compare(This, y) < 0
    174163        End Function
     
    178167        End Function
    179168
    180         Const Function Operator > (y As *StrChar) As Boolean
     169        Const Function Operator > (y As *Char) As Boolean
    181170            Return Compare(This, y) > 0
    182171        End Function
     
    186175        End Function
    187176
    188         Const Function Operator <= (y As *StrChar) As Boolean
     177        Const Function Operator <= (y As *Char) As Boolean
    189178            Return Compare(This, y) <= 0
    190179        End Function
     
    194183        End Function
    195184
    196         Const Function Operator >= (y As *StrChar) As Boolean
     185        Const Function Operator >= (y As *Char) As Boolean
    197186            Return Compare(This, y) >= 0
    198187        End Function
     
    217206        End Function
    218207    Private
    219         Static Function Compare(x As String, y As *StrChar) As Long
     208        Static Function Compare(x As String, y As *Char) As Long
    220209            Return CompareOrdinal(x, y)
    221210        End Function
    222211
    223         Static Function CompareOrdinal(x As String, y As *StrChar) As Long
     212        Static Function CompareOrdinal(x As String, y As *Char) As Long
    224213            Return CompareOrdinal(StrPtr(x), y)
    225214        End Function
    226215
    227         Static Function CompareOrdinal(x As *StrChar, y As *StrChar) As Long
     216        Static Function CompareOrdinal(x As *Char, y As *Char) As Long
    228217            If x = 0 Then
    229218                If y = 0 Then
     
    238227        End Function
    239228
    240         Static Function CompareOrdinal(x As *StrChar, indexX As Long, y As *StrChar, indexY As Long, length As Long) As Long
     229        Static Function CompareOrdinal(x As *Char, indexX As Long, y As *Char, indexY As Long, length As Long) As Long
    241230            If x = 0 Then
    242231                If y = 0 Then
     
    273262        End Function
    274263
    275         Const Function StrPtr() As *StrChar
     264        Const Function StrPtr() As *Char
    276265            Return Chars
    277266        End Function
     
    280269        Sub Assign(text As PCSTR, textLengthA As Long)
    281270#ifdef __STRING_IS_NOT_UNICODE
    282             AssignFromStrChar(text, textLengthA)
     271            AssignFromCharPtr(text, textLengthA)
    283272#else
    284273            Dim textLengthW = MultiByteToWideChar(CP_THREAD_ACP, 0, text, textLengthA, 0, 0)
     
    298287            End If
    299288#else
    300             AssignFromStrChar(text, textLengthW)
     289            AssignFromCharPtr(text, textLengthW)
    301290#endif
    302291        End Sub
    303292
    304293    Private
    305         Static Function ConcatStrChar(text1 As *StrChar, text1Length As Long, text2 As *StrChar, text2Length As Long) As String
    306             ConcatStrChar = New String()
    307             With ConcatStrChar
     294        Static Function ConcatChar(text1 As *Char, text1Length As Long, text2 As *Char, text2Length As Long) As String
     295            ConcatChar = New String()
     296            With ConcatChar
    308297                .AllocStringBuffer(text1Length + text2Length)
    309298                ActiveBasic.Strings.ChrCopy(.Chars, text1, text1Length As SIZE_T)
     
    315304        Const Function Concat(text As PCSTR, len As Long) As String
    316305#ifdef __STRING_IS_NOT_UNICODE
    317             Return ConcatStrChar(This.Chars, m_Length, text, len)
     306            Return ConcatChar(This.Chars, m_Length, text, len)
    318307#else
    319308            With Concat
     
    339328            End With
    340329#else
    341             Return ConcatStrChar(This.Chars, m_Length, text, len)
     330            Return ConcatChar(This.Chars, m_Length, text, len)
    342331#endif
    343332        End Function
     
    375364        End Function
    376365
    377         Const Function Contains(c As StrChar) As Boolean
     366        Const Function Contains(c As Char) As Boolean
    378367            Return IndexOf(c) >= 0
    379368        End Function
     
    389378        End Function
    390379
    391         Const Function IndexOf(c As StrChar) As Long
     380        Const Function IndexOf(c As Char) As Long
    392381            Return indexOfCore(c, 0, m_Length)
    393382        End Function
    394383
    395         Const Function IndexOf(c As StrChar, start As Long) As Long
     384        Const Function IndexOf(c As Char, start As Long) As Long
    396385            rangeCheck(start)
    397386            Return indexOfCore(c, start, m_Length - start)
    398387        End Function
    399388
    400         Const Function IndexOf(c As StrChar, start As Long, count As Long) As Long
     389        Const Function IndexOf(c As Char, start As Long, count As Long) As Long
    401390            rangeCheck(start, count)
    402391            Return indexOfCore(c, start, count)
    403392        End Function
    404393    Private
    405         Const Function indexOfCore(c As StrChar, start As Long, count As Long) As Long
     394        Const Function indexOfCore(c As Char, start As Long, count As Long) As Long
    406395            indexOfCore = ActiveBasic.Strings.ChrFind(VarPtr(Chars[start]), count, c) As Long
    407396            If indexOfCore <> -1 Then
     
    440429        End Function
    441430
    442         Const Function LastIndexOf(c As StrChar) As Long
     431        Const Function LastIndexOf(c As Char) As Long
    443432            Return lastIndexOf(c, m_Length - 1, m_Length)
    444433        End Function
    445434
    446         Const Function LastIndexOf(c As StrChar, start As Long) As Long
     435        Const Function LastIndexOf(c As Char, start As Long) As Long
    447436            rangeCheck(start)
    448437            Return lastIndexOf(c, start, start + 1)
    449438        End Function
    450439
    451         Const Function LastIndexOf(c As StrChar, start As Long, count As Long) As Long
     440        Const Function LastIndexOf(c As Char, start As Long, count As Long) As Long
    452441            rangeCheck(start)
    453442            Dim lastFindPos = start - (count - 1)
     
    458447        End Function
    459448    Private
    460         Const Function lastIndexOf(c As StrChar, start As Long, count As Long) As Long
     449        Const Function lastIndexOf(c As Char, start As Long, count As Long) As Long
    461450            Dim lastFindPos = start - (count - 1)
    462451            Dim i As Long
     
    504493        End Function
    505494
    506         Const Function StartsWith(c As StrChar) As Boolean
     495        Const Function StartsWith(c As Char) As Boolean
    507496            Return IndexOf(c) = 0
    508497        End Function
     
    512501        End Function
    513502
    514         Const Function EndsWith(c As StrChar) As Boolean
     503        Const Function EndsWith(c As Char) As Boolean
    515504            Return LastIndexOf(c) = m_Length - 1
    516505        End Function
     
    556545        End Function
    557546
    558         Const Function Replace(oldChar As StrChar, newChar As StrChar) As String
     547        Const Function Replace(oldChar As Char, newChar As Char) As String
    559548            Dim sb = New Text.StringBuilder(This)
    560549            sb.Replace(oldChar, newChar)
     
    604593        End Function
    605594
    606         Sub CopyTo(sourceIndex As Long, destination As *StrChar, destinationIndex As Long, count As Long)
     595        Sub CopyTo(sourceIndex As Long, destination As *Char, destinationIndex As Long, count As Long)
    607596            ActiveBasic.Strings.ChrCopy(VarPtr(destination[destinationIndex]), VarPtr(Chars[sourceIndex]), count As SIZE_T)
    608597        End Sub
     
    618607
    619608        Function PadLeft(total As Long) As String
    620             PadLeft(total, &h30 As StrChar)
    621         End Function
    622 
    623         Function PadLeft(total As Long, c As StrChar) As String
     609            PadLeft(total, &h30 As Char)
     610        End Function
     611
     612        Function PadLeft(total As Long, c As Char) As String
    624613            If total < 0 Then
    625614                Throw New ArgumentOutOfRangeException("String.PadLeft: An arguments is out of range value.", "total")
     
    635624
    636625        Function PadRight(total As Long) As String
    637             PadRight(total, &h30 As StrChar)
    638         End Function
    639 
    640         Function PadRight(total As Long, c As StrChar) As String
     626            PadRight(total, &h30 As Char)
     627        End Function
     628
     629        Function PadRight(total As Long, c As Char) As String
    641630            If total < 0 Then
    642631                Throw New ArgumentOutOfRangeException("String.PadRight: An arguments is out of range value.", "total")
     
    651640        End Function
    652641    Private
    653         Function AllocStringBuffer(textLength As Long) As *StrChar
     642        Function AllocStringBuffer(textLength As Long) As *Char
    654643            If textLength < 0 Then
    655644                Return 0
    656645            End If
    657             AllocStringBuffer = GC_malloc_atomic(SizeOf(StrChar) * (textLength + 1))
     646            AllocStringBuffer = GC_malloc_atomic(SizeOf(Char) * (textLength + 1))
    658647            If AllocStringBuffer = 0 Then
    659648                'Throw New OutOfMemoryException
     
    663652        End Function
    664653
    665         Sub AssignFromStrChar(text As *StrChar, textLength As Long)
     654        Sub AssignFromCharPtr(text As *Char, textLength As Long)
    666655            AllocStringBuffer(textLength)
    667656            ActiveBasic.Strings.ChrCopy(Chars, text, textLength As SIZE_T)
  • trunk/Include/Classes/System/Text/StringBuilder.ab

    r457 r468  
    4040    End Function
    4141
    42     Function Append(x As StrChar) As StringBuilder
     42    Function Append(x As Char) As StringBuilder
    4343        EnsureCapacity(size + 1)
    4444        separateBuffer()
     
    4747        Return This
    4848    End Function
    49 
    50 #ifdef __STRING_IS_NOT_UNICODE
     49#ifdef UNICODE
     50    Function Append(x As SByte) As StringBuilder
     51        ActiveBasic.Strings.Detail.FormatIntegerD(This, x, DWORD_MAX, 0, 0)
     52        Return This
     53    End Function
     54#endif
     55    Function Append(x As Byte) As StringBuilder
     56        ActiveBasic.Strings.Detail.FormatIntegerU(This, x, DWORD_MAX, 0, 0)
     57        Return This
     58    End Function
     59
     60    Function Append(x As Integer) As StringBuilder
     61        ActiveBasic.Strings.Detail.FormatIntegerD(This, x, DWORD_MAX, 0, 0)
     62        Return This
     63    End Function
     64#ifndef UNICODE
    5165    Function Append(x As Word) As StringBuilder
    52         Append(Str$(x As DWord))
    53         Return This
    54     End Function
    55 #else
    56     Function Append(x As SByte) As StringBuilder
    57         Append(Str$(x As Long))
     66        ActiveBasic.Strings.Detail.FormatIntegerU(This, x, DWORD_MAX, 0, 0)
    5867        Return This
    5968    End Function
    6069#endif
    61    
    62     Function Append(x As Byte) As StringBuilder
    63         Append(Str$(x As DWord))
    64         Return This
    65     End Function
    66 
    67     Function Append(x As Integer) As StringBuilder
    68         Append(Str$(x As Long))
    69         Return This
    70     End Function
    71 
    7270    Function Append(x As Long) As StringBuilder
    73         Append(Str$(x))
     71        ActiveBasic.Strings.Detail.FormatIntegerD(This, x, DWORD_MAX, 0, 0)
    7472        Return This
    7573    End Function
    7674
    7775    Function Append(x As DWord) As StringBuilder
    78         Append(Str$(x))
     76        ActiveBasic.Strings.Detail.FormatIntegerU(This, x, DWORD_MAX, 0, 0)
    7977        Return This
    8078    End Function
    8179
    8280    Function Append(x As Int64) As StringBuilder
    83         Append(Str$(x))
     81        ActiveBasic.Strings.Detail.FormatIntegerLD(This, x, DWORD_MAX, 0, 0)
    8482        Return This
    8583    End Function
    8684
    8785    Function Append(x As QWord) As StringBuilder
    88         Append(Str$(x))
     86        ActiveBasic.Strings.Detail.FormatIntegerLU(This, x, DWORD_MAX, 0, 0)
    8987        Return This
    9088    End Function
    9189
    9290    Function Append(x As Single) As StringBuilder
    93         Append(Str$(x))
     91        ActiveBasic.Strings.Detail.FormatFloatG(This, x, DWORD_MAX, 0, 0)
    9492        Return This
    9593    End Function
    9694
    9795    Function Append(x As Double) As StringBuilder
    98         Append(Str$(x))
     96        ActiveBasic.Strings.Detail.FormatFloatG(This, x, DWORD_MAX, 0, 0)
    9997        Return This
    10098    End Function
     
    105103    End Function
    106104
    107     Function Append(c As StrChar, n As Long) As StringBuilder
     105    Function Append(c As Char, n As Long) As StringBuilder
    108106        EnsureCapacity(size + n)
    109107        ActiveBasic.Strings.ChrFill(VarPtr(chars[size]), n As SIZE_T, c)
     
    123121    End Function
    124122
    125     Function Append(s As *StrChar, startIndex As Long, count As Long) As StringBuilder
     123    Function Append(s As *Char, startIndex As Long, count As Long) As StringBuilder
    126124        If s = 0 Then
    127125            If startIndex = 0 And count = 0 Then
     
    137135    End Function
    138136Private
    139     Sub appendCore(s As *StrChar, start As Long, count As Long)
     137    Sub appendCore(s As *Char, start As Long, count As Long)
    140138        EnsureCapacity(size + count)
    141139        separateBuffer()
     
    167165    End Function
    168166
    169     Const Sub CopyTo(sourceIndex As Long, ByRef dest[] As StrChar, destIndex As Long, count As Long)
     167    Const Sub CopyTo(sourceIndex As Long, ByRef dest[] As Char, destIndex As Long, count As Long)
    170168        If dest = 0 Then
    171169            Throw New ArgumentNullException("StringBuilder.CopyTo: An argument is null", "sourceIndex")
     
    174172        End If
    175173
    176         memcpy(VarPtr(dest[destIndex]), VarPtr(chars[sourceIndex]), count * SizeOf (StrChar))
     174        memcpy(VarPtr(dest[destIndex]), VarPtr(chars[sourceIndex]), count * SizeOf (Char))
    177175    End Sub
    178176
     
    181179            Throw New ArgumentOutOfRangeException("StringBuilder.Append: An argument is out of range value.", "c")
    182180        ElseIf c > Capacity Then
    183             Dim p = GC_malloc_atomic((c + 1) * SizeOf (StrChar)) As *StrChar
     181            Dim p = GC_malloc_atomic((c + 1) * SizeOf (Char)) As *Char
    184182            ActiveBasic.Strings.ChrCopy(p, chars, size As SIZE_T)
    185183            chars = p
     
    212210    End Function
    213211
    214     Function Insert(i As Long, x As StrChar) As StringBuilder
     212    Function Insert(i As Long, x As Char) As StringBuilder
    215213        Insert(i, VarPtr(x), 0, 1)
    216214        Return This
     
    303301    End Function
    304302
    305     Function Insert(i As Long, x As *StrChar, index As Long, count As Long) As StringBuilder
     303    Function Insert(i As Long, x As *Char, index As Long, count As Long) As StringBuilder
    306304        rangeCheck(i)
    307305        If x = 0 Then
     
    342340    End Function
    343341
    344     Function Replace(oldChar As StrChar, newChar As StrChar) As StringBuilder
     342    Function Replace(oldChar As Char, newChar As Char) As StringBuilder
    345343        replaceCore(oldChar, newChar, 0, size)
    346344        Return This
     
    352350    End Function
    353351
    354     Function Replace(oldChar As StrChar, newChar As StrChar, startIndex As Long, count As Long) As StringBuilder
     352    Function Replace(oldChar As Char, newChar As Char, startIndex As Long, count As Long) As StringBuilder
    355353        rangeCheck(startIndex, count)
    356354        replaceCore(oldChar, newChar, startIndex, count)
     
    364362    End Function
    365363Private
    366     Sub replaceCore(oldChar As StrChar, newChar As StrChar, start As Long, count As Long)
     364    Sub replaceCore(oldChar As Char, newChar As Char, start As Long, count As Long)
    367365        separateBuffer()
    368366        Dim i As Long
     
    386384        Dim last = start + count
    387385        Do
    388             Dim nextPos = ActiveBasic.Strings.ChrFind(VarPtr(chars[curPos]) As *StrChar, size As SIZE_T, StrPtr(oldStr), oldStr.Length As SIZE_T) As Long
     386            Dim nextPos = ActiveBasic.Strings.ChrFind(VarPtr(chars[curPos]) As *Char, size As SIZE_T, StrPtr(oldStr), oldStr.Length As SIZE_T) As Long
    389387            If nextPos = -1 As SIZE_T Or curPos > last Then
    390388                s.appendCore(chars, curPos, size - curPos)
     
    411409    End Function
    412410
    413     Const Function Operator [](i As Long) As StrChar
     411    Const Function Operator [](i As Long) As Char
    414412        Return Chars[i]
    415413    End Function
    416414
    417     Sub Operator []=(i As Long, c As StrChar)
     415    Sub Operator []=(i As Long, c As Char)
    418416        Chars[i] = c
    419417    End Sub
     
    431429    End Sub
    432430
    433     Const Function Chars(i As Long) As StrChar
     431    Const Function Chars(i As Long) As Char
    434432        If i >= Length Or i < 0 Then
    435433            Throw New IndexOutOfRangeException("StringBuilder.Chars: The index argument 'i' is out of range value.")
     
    438436    End Function
    439437
    440     Sub Chars(i As Long, c As StrChar)
     438    Sub Chars(i As Long, c As Char)
    441439        If i >= Length Or i < 0 Then
    442440            Throw New ArgumentOutOfRangeException("StringBuilder.Chars: An argument is out of range value.", "i")
     
    452450        EnsureCapacity(i) 'iが適切な値かどうかの確認はこの中で行う
    453451        If size < i Then
    454             ActiveBasic.Strings.ChrFill(VarPtr(chars[size]), (i - size + 1) As SIZE_T, 0 As StrChar)
     452            ActiveBasic.Strings.ChrFill(VarPtr(chars[size]), (i - size + 1) As SIZE_T, 0 As Char)
    455453        End If
    456454        size = i
     
    461459    End Function
    462460
    463     Function __Chars() As *StrChar
     461    Function __Chars() As *Char
    464462        Return chars
    465463    End Function
     
    483481        This.maxCapacity = maxCapacity
    484482        This.size = 0
    485         This.chars = GC_malloc_atomic((This.capacity + 1) * SizeOf (StrChar))
     483        This.chars = GC_malloc_atomic((This.capacity + 1) * SizeOf (Char))
    486484    End Sub
    487485
     
    516514    Sub separateBuffer()
    517515        If stringized Then
    518             Dim newChars = GC_malloc_atomic(SizeOf (StrChar) * capacity) As *StrChar
     516            Dim newChars = GC_malloc_atomic(SizeOf (Char) * capacity) As *Char
    519517            ActiveBasic.Strings.ChrCopy(newChars, chars, capacity As SIZE_T)
    520518            chars = newChars
     
    523521    End Sub
    524522
    525     chars As *StrChar
     523    chars As *Char
    526524    maxCapacity As Long
    527525    capacity As Long
     
    534532
    535533'暫定
    536 Function StrPtr(sb As System.Text.StringBuilder) As *StrChar
     534Function StrPtr(sb As System.Text.StringBuilder) As *Char
    537535    Return sb.__Chars
    538536End Function
  • trunk/Include/Classes/System/Xml/XmlDocument.ab

    r463 r468  
    136136        Save( fileStream )
    137137    End Sub
     138
     139    /*!
     140    @brief  指定したテキストライタにXML文書を保存する。
     141    @param  テキストライタ。
     142    */
     143    Virtual Sub Save( writer As System.IO.TextWriter )
     144        writer.Write(InnerXmlSupportedIndent( True ))
     145    End Sub
    138146End Class
    139147
  • trunk/Include/Classes/System/misc.ab

    r467 r468  
    11' Classes/System/misc.ab
    2 
    3 #ifndef __SYSTEM_MISC_AB__
    4 #define __SYSTEM_MISC_AB__
    5 
    6 '#require <Classes/System/Threading/WaitHandle.ab>
    72
    83Namespace System
     
    3631End Class
    3732
     33Delegate Sub EventHandler(sender As Object, e As EventArgs)
     34
    3835Delegate Sub AsyncCallback(ar As IAsyncResult)
    3936
    40 
    4137End Namespace 'System
    42 #require <Classes/System/Threading/WaitHandle.ab>
    43 
    44 #endif '__SYSTEM_MISC_AB__
Note: See TracChangeset for help on using the changeset viewer.