Changeset 468 for trunk/Include/Classes/System
- Timestamp:
- Mar 9, 2008, 12:00:01 PM (17 years ago)
- Location:
- trunk/Include/Classes/System
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/Classes/System/IO/DirectoryInfo.ab
r409 r468 59 59 Select Case error 60 60 Case ERROR_ALREADY_EXISTS 61 Throw New IOException("DirectoryInfo.CreateDirectory: The directory has already existed.")61 Exit Sub 'ディレクトリが既に存在するときは、何もしない。 62 62 Case Else 63 63 Throw New IOException("DirectoryInfo.CreateDirectory: Failed to CreateDirectory") -
trunk/Include/Classes/System/IO/Path.ab
r429 r468 88 88 */ 89 89 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 91 95 End Function 92 96 … … 172 176 Static Function GetTempPath() As String 173 177 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)) 176 181 If (len > size) or len = 0 Then 177 182 Throw New IOException("Path.GetTempPath: Failed to GetTempPath.") 178 183 Else 179 Return New String(p, len As Long) 184 buf.Length = len 185 Return buf.ToString 180 186 End If 181 187 End Function … … 209 215 Static Const ExtensionSeparatorChar = &H2E As StrChar 210 216 Static Const InvalidPathChars = Ex"\q<>|\0\t" As String 211 Static Const UniformNamingConventionString = Ex"\\\\" As String217 Static Const UniformNamingConventionString = "\\" As String 212 218 213 219 '---------------------------------------------------------------- … … 227 233 Dim i As Long 228 234 For i = 0 To ELM(InvalidPathChars.Length) 229 If path.Contains(InvalidPathChars .Substring(i, 1)) Then235 If path.Contains(InvalidPathChars[i]) Then 230 236 Throw New IOException("Path.CheckPath: The path contains invalidPathChars.") 231 237 End If -
trunk/Include/Classes/System/IO/Stream.ab
r432 r468 7 7 8 8 Public 'Protected 9 Sub Stream(): End Sub 9 Sub Stream() 10 End Sub 10 11 Public 11 12 Virtual Sub ~Stream() … … 54 55 Dispose(True) 55 56 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 58 61 Abstract Sub Flush() 59 62 Abstract Function Read(buffer As *Byte, offset As Long, count As Long) As Long … … 72 75 Abstract Sub SetLength(value As Int64) 73 76 Abstract Sub Write(buffer As *Byte, offset As Long, count As Long) 74 75 77 Virtual Sub WriteByte(b As Byte) 76 78 Write(VarPtr(b), 0, 1) -
trunk/Include/Classes/System/IO/StreamWriter.ab
r271 r468 4 4 5 5 Class StreamWriter 6 ' TODO: 実装 6 Inherits TextWriter 7 Public 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 85 Protected 86 Override Sub Dispose(disposing As Boolean) 87 If disposing Then 88 s.Dispose() 89 End If 90 End Sub 91 92 Private 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 7 100 End Class 8 101 -
trunk/Include/Classes/System/IO/TextReader.ab
r457 r468 101 101 102 102 Protected 103 Abstract Sub Dispose(disposing As Boolean) 103 Virtual Sub Dispose(disposing As Boolean) 104 End Sub 104 105 105 106 /* -
trunk/Include/Classes/System/String.ab
r457 r468 5 5 #require <Classes/ActiveBasic/Strings/Strings.ab> 6 6 7 #ifdef __STRING_IS_NOT_ALWAYS_UNICODE8 9 #ifndef UNICODE10 7 TypeDef StrChar = Char 11 #define __STRING_IS_NOT_UNICODE12 #endif13 14 #endif15 16 #ifndef __STRING_IS_NOT_UNICODE17 TypeDef StrChar = WCHAR18 8 19 9 #ifdef UNICODE 20 10 #define __STRING_IS_UNICODE 21 11 #else 22 #define __STRING_ UNICODE_WINDOWS_ANSI12 #define __STRING_IS_NOT_UNICODE 23 13 #endif 24 #endif25 14 26 15 Namespace System 27 16 28 17 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>*/ 30 19 31 20 m_Length As Long 32 Chars As * StrChar21 Chars As *Char 33 22 34 23 Sub validPointerCheck(p As VoidPtr, size = 1 As Long) … … 89 78 End Sub 90 79 91 Sub String(initChar As StrChar, length As Long)80 Sub String(initChar As Char, length As Long) 92 81 AllocStringBuffer(length) 93 82 ActiveBasic.Strings.ChrFill(Chars, length, initChar) … … 105 94 End Function 106 95 107 Function Operator() As * StrChar96 Function Operator() As *Char 108 97 Return Chars 109 98 End Function 110 99 111 Const Function Operator [] (n As Long) As StrChar100 Const Function Operator [] (n As Long) As Char 112 101 rangeCheck(n) 113 102 Return Chars[n] … … 154 143 End Function 155 144 156 Const Function Operator == (y As * StrChar) As Boolean145 Const Function Operator == (y As *Char) As Boolean 157 146 Return Compare(This, y) = 0 158 147 End Function … … 162 151 End Function 163 152 164 Const Function Operator <> (y As * StrChar) As Boolean153 Const Function Operator <> (y As *Char) As Boolean 165 154 Return Compare(This, y) <> 0 166 155 End Function … … 170 159 End Function 171 160 172 Const Function Operator < (y As * StrChar) As Boolean161 Const Function Operator < (y As *Char) As Boolean 173 162 Return Compare(This, y) < 0 174 163 End Function … … 178 167 End Function 179 168 180 Const Function Operator > (y As * StrChar) As Boolean169 Const Function Operator > (y As *Char) As Boolean 181 170 Return Compare(This, y) > 0 182 171 End Function … … 186 175 End Function 187 176 188 Const Function Operator <= (y As * StrChar) As Boolean177 Const Function Operator <= (y As *Char) As Boolean 189 178 Return Compare(This, y) <= 0 190 179 End Function … … 194 183 End Function 195 184 196 Const Function Operator >= (y As * StrChar) As Boolean185 Const Function Operator >= (y As *Char) As Boolean 197 186 Return Compare(This, y) >= 0 198 187 End Function … … 217 206 End Function 218 207 Private 219 Static Function Compare(x As String, y As * StrChar) As Long208 Static Function Compare(x As String, y As *Char) As Long 220 209 Return CompareOrdinal(x, y) 221 210 End Function 222 211 223 Static Function CompareOrdinal(x As String, y As * StrChar) As Long212 Static Function CompareOrdinal(x As String, y As *Char) As Long 224 213 Return CompareOrdinal(StrPtr(x), y) 225 214 End Function 226 215 227 Static Function CompareOrdinal(x As * StrChar, y As *StrChar) As Long216 Static Function CompareOrdinal(x As *Char, y As *Char) As Long 228 217 If x = 0 Then 229 218 If y = 0 Then … … 238 227 End Function 239 228 240 Static Function CompareOrdinal(x As * StrChar, indexX As Long, y As *StrChar, indexY As Long, length As Long) As Long229 Static Function CompareOrdinal(x As *Char, indexX As Long, y As *Char, indexY As Long, length As Long) As Long 241 230 If x = 0 Then 242 231 If y = 0 Then … … 273 262 End Function 274 263 275 Const Function StrPtr() As * StrChar264 Const Function StrPtr() As *Char 276 265 Return Chars 277 266 End Function … … 280 269 Sub Assign(text As PCSTR, textLengthA As Long) 281 270 #ifdef __STRING_IS_NOT_UNICODE 282 AssignFrom StrChar(text, textLengthA)271 AssignFromCharPtr(text, textLengthA) 283 272 #else 284 273 Dim textLengthW = MultiByteToWideChar(CP_THREAD_ACP, 0, text, textLengthA, 0, 0) … … 298 287 End If 299 288 #else 300 AssignFrom StrChar(text, textLengthW)289 AssignFromCharPtr(text, textLengthW) 301 290 #endif 302 291 End Sub 303 292 304 293 Private 305 Static Function Concat StrChar(text1 As *StrChar, text1Length As Long, text2 As *StrChar, text2Length As Long) As String306 Concat StrChar = New String()307 With Concat StrChar294 Static Function ConcatChar(text1 As *Char, text1Length As Long, text2 As *Char, text2Length As Long) As String 295 ConcatChar = New String() 296 With ConcatChar 308 297 .AllocStringBuffer(text1Length + text2Length) 309 298 ActiveBasic.Strings.ChrCopy(.Chars, text1, text1Length As SIZE_T) … … 315 304 Const Function Concat(text As PCSTR, len As Long) As String 316 305 #ifdef __STRING_IS_NOT_UNICODE 317 Return Concat StrChar(This.Chars, m_Length, text, len)306 Return ConcatChar(This.Chars, m_Length, text, len) 318 307 #else 319 308 With Concat … … 339 328 End With 340 329 #else 341 Return Concat StrChar(This.Chars, m_Length, text, len)330 Return ConcatChar(This.Chars, m_Length, text, len) 342 331 #endif 343 332 End Function … … 375 364 End Function 376 365 377 Const Function Contains(c As StrChar) As Boolean366 Const Function Contains(c As Char) As Boolean 378 367 Return IndexOf(c) >= 0 379 368 End Function … … 389 378 End Function 390 379 391 Const Function IndexOf(c As StrChar) As Long380 Const Function IndexOf(c As Char) As Long 392 381 Return indexOfCore(c, 0, m_Length) 393 382 End Function 394 383 395 Const Function IndexOf(c As StrChar, start As Long) As Long384 Const Function IndexOf(c As Char, start As Long) As Long 396 385 rangeCheck(start) 397 386 Return indexOfCore(c, start, m_Length - start) 398 387 End Function 399 388 400 Const Function IndexOf(c As StrChar, start As Long, count As Long) As Long389 Const Function IndexOf(c As Char, start As Long, count As Long) As Long 401 390 rangeCheck(start, count) 402 391 Return indexOfCore(c, start, count) 403 392 End Function 404 393 Private 405 Const Function indexOfCore(c As StrChar, start As Long, count As Long) As Long394 Const Function indexOfCore(c As Char, start As Long, count As Long) As Long 406 395 indexOfCore = ActiveBasic.Strings.ChrFind(VarPtr(Chars[start]), count, c) As Long 407 396 If indexOfCore <> -1 Then … … 440 429 End Function 441 430 442 Const Function LastIndexOf(c As StrChar) As Long431 Const Function LastIndexOf(c As Char) As Long 443 432 Return lastIndexOf(c, m_Length - 1, m_Length) 444 433 End Function 445 434 446 Const Function LastIndexOf(c As StrChar, start As Long) As Long435 Const Function LastIndexOf(c As Char, start As Long) As Long 447 436 rangeCheck(start) 448 437 Return lastIndexOf(c, start, start + 1) 449 438 End Function 450 439 451 Const Function LastIndexOf(c As StrChar, start As Long, count As Long) As Long440 Const Function LastIndexOf(c As Char, start As Long, count As Long) As Long 452 441 rangeCheck(start) 453 442 Dim lastFindPos = start - (count - 1) … … 458 447 End Function 459 448 Private 460 Const Function lastIndexOf(c As StrChar, start As Long, count As Long) As Long449 Const Function lastIndexOf(c As Char, start As Long, count As Long) As Long 461 450 Dim lastFindPos = start - (count - 1) 462 451 Dim i As Long … … 504 493 End Function 505 494 506 Const Function StartsWith(c As StrChar) As Boolean495 Const Function StartsWith(c As Char) As Boolean 507 496 Return IndexOf(c) = 0 508 497 End Function … … 512 501 End Function 513 502 514 Const Function EndsWith(c As StrChar) As Boolean503 Const Function EndsWith(c As Char) As Boolean 515 504 Return LastIndexOf(c) = m_Length - 1 516 505 End Function … … 556 545 End Function 557 546 558 Const Function Replace(oldChar As StrChar, newChar As StrChar) As String547 Const Function Replace(oldChar As Char, newChar As Char) As String 559 548 Dim sb = New Text.StringBuilder(This) 560 549 sb.Replace(oldChar, newChar) … … 604 593 End Function 605 594 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) 607 596 ActiveBasic.Strings.ChrCopy(VarPtr(destination[destinationIndex]), VarPtr(Chars[sourceIndex]), count As SIZE_T) 608 597 End Sub … … 618 607 619 608 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 String609 PadLeft(total, &h30 As Char) 610 End Function 611 612 Function PadLeft(total As Long, c As Char) As String 624 613 If total < 0 Then 625 614 Throw New ArgumentOutOfRangeException("String.PadLeft: An arguments is out of range value.", "total") … … 635 624 636 625 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 String626 PadRight(total, &h30 As Char) 627 End Function 628 629 Function PadRight(total As Long, c As Char) As String 641 630 If total < 0 Then 642 631 Throw New ArgumentOutOfRangeException("String.PadRight: An arguments is out of range value.", "total") … … 651 640 End Function 652 641 Private 653 Function AllocStringBuffer(textLength As Long) As * StrChar642 Function AllocStringBuffer(textLength As Long) As *Char 654 643 If textLength < 0 Then 655 644 Return 0 656 645 End If 657 AllocStringBuffer = GC_malloc_atomic(SizeOf( StrChar) * (textLength + 1))646 AllocStringBuffer = GC_malloc_atomic(SizeOf(Char) * (textLength + 1)) 658 647 If AllocStringBuffer = 0 Then 659 648 'Throw New OutOfMemoryException … … 663 652 End Function 664 653 665 Sub AssignFrom StrChar(text As *StrChar, textLength As Long)654 Sub AssignFromCharPtr(text As *Char, textLength As Long) 666 655 AllocStringBuffer(textLength) 667 656 ActiveBasic.Strings.ChrCopy(Chars, text, textLength As SIZE_T) -
trunk/Include/Classes/System/Text/StringBuilder.ab
r457 r468 40 40 End Function 41 41 42 Function Append(x As StrChar) As StringBuilder42 Function Append(x As Char) As StringBuilder 43 43 EnsureCapacity(size + 1) 44 44 separateBuffer() … … 47 47 Return This 48 48 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 51 65 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) 58 67 Return This 59 68 End Function 60 69 #endif 61 62 Function Append(x As Byte) As StringBuilder63 Append(Str$(x As DWord))64 Return This65 End Function66 67 Function Append(x As Integer) As StringBuilder68 Append(Str$(x As Long))69 Return This70 End Function71 72 70 Function Append(x As Long) As StringBuilder 73 A ppend(Str$(x))71 ActiveBasic.Strings.Detail.FormatIntegerD(This, x, DWORD_MAX, 0, 0) 74 72 Return This 75 73 End Function 76 74 77 75 Function Append(x As DWord) As StringBuilder 78 A ppend(Str$(x))76 ActiveBasic.Strings.Detail.FormatIntegerU(This, x, DWORD_MAX, 0, 0) 79 77 Return This 80 78 End Function 81 79 82 80 Function Append(x As Int64) As StringBuilder 83 A ppend(Str$(x))81 ActiveBasic.Strings.Detail.FormatIntegerLD(This, x, DWORD_MAX, 0, 0) 84 82 Return This 85 83 End Function 86 84 87 85 Function Append(x As QWord) As StringBuilder 88 A ppend(Str$(x))86 ActiveBasic.Strings.Detail.FormatIntegerLU(This, x, DWORD_MAX, 0, 0) 89 87 Return This 90 88 End Function 91 89 92 90 Function Append(x As Single) As StringBuilder 93 A ppend(Str$(x))91 ActiveBasic.Strings.Detail.FormatFloatG(This, x, DWORD_MAX, 0, 0) 94 92 Return This 95 93 End Function 96 94 97 95 Function Append(x As Double) As StringBuilder 98 A ppend(Str$(x))96 ActiveBasic.Strings.Detail.FormatFloatG(This, x, DWORD_MAX, 0, 0) 99 97 Return This 100 98 End Function … … 105 103 End Function 106 104 107 Function Append(c As StrChar, n As Long) As StringBuilder105 Function Append(c As Char, n As Long) As StringBuilder 108 106 EnsureCapacity(size + n) 109 107 ActiveBasic.Strings.ChrFill(VarPtr(chars[size]), n As SIZE_T, c) … … 123 121 End Function 124 122 125 Function Append(s As * StrChar, startIndex As Long, count As Long) As StringBuilder123 Function Append(s As *Char, startIndex As Long, count As Long) As StringBuilder 126 124 If s = 0 Then 127 125 If startIndex = 0 And count = 0 Then … … 137 135 End Function 138 136 Private 139 Sub appendCore(s As * StrChar, start As Long, count As Long)137 Sub appendCore(s As *Char, start As Long, count As Long) 140 138 EnsureCapacity(size + count) 141 139 separateBuffer() … … 167 165 End Function 168 166 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) 170 168 If dest = 0 Then 171 169 Throw New ArgumentNullException("StringBuilder.CopyTo: An argument is null", "sourceIndex") … … 174 172 End If 175 173 176 memcpy(VarPtr(dest[destIndex]), VarPtr(chars[sourceIndex]), count * SizeOf ( StrChar))174 memcpy(VarPtr(dest[destIndex]), VarPtr(chars[sourceIndex]), count * SizeOf (Char)) 177 175 End Sub 178 176 … … 181 179 Throw New ArgumentOutOfRangeException("StringBuilder.Append: An argument is out of range value.", "c") 182 180 ElseIf c > Capacity Then 183 Dim p = GC_malloc_atomic((c + 1) * SizeOf ( StrChar)) As *StrChar181 Dim p = GC_malloc_atomic((c + 1) * SizeOf (Char)) As *Char 184 182 ActiveBasic.Strings.ChrCopy(p, chars, size As SIZE_T) 185 183 chars = p … … 212 210 End Function 213 211 214 Function Insert(i As Long, x As StrChar) As StringBuilder212 Function Insert(i As Long, x As Char) As StringBuilder 215 213 Insert(i, VarPtr(x), 0, 1) 216 214 Return This … … 303 301 End Function 304 302 305 Function Insert(i As Long, x As * StrChar, index As Long, count As Long) As StringBuilder303 Function Insert(i As Long, x As *Char, index As Long, count As Long) As StringBuilder 306 304 rangeCheck(i) 307 305 If x = 0 Then … … 342 340 End Function 343 341 344 Function Replace(oldChar As StrChar, newChar As StrChar) As StringBuilder342 Function Replace(oldChar As Char, newChar As Char) As StringBuilder 345 343 replaceCore(oldChar, newChar, 0, size) 346 344 Return This … … 352 350 End Function 353 351 354 Function Replace(oldChar As StrChar, newChar As StrChar, startIndex As Long, count As Long) As StringBuilder352 Function Replace(oldChar As Char, newChar As Char, startIndex As Long, count As Long) As StringBuilder 355 353 rangeCheck(startIndex, count) 356 354 replaceCore(oldChar, newChar, startIndex, count) … … 364 362 End Function 365 363 Private 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) 367 365 separateBuffer() 368 366 Dim i As Long … … 386 384 Dim last = start + count 387 385 Do 388 Dim nextPos = ActiveBasic.Strings.ChrFind(VarPtr(chars[curPos]) As * StrChar, size As SIZE_T, StrPtr(oldStr), oldStr.Length As SIZE_T) As Long386 Dim nextPos = ActiveBasic.Strings.ChrFind(VarPtr(chars[curPos]) As *Char, size As SIZE_T, StrPtr(oldStr), oldStr.Length As SIZE_T) As Long 389 387 If nextPos = -1 As SIZE_T Or curPos > last Then 390 388 s.appendCore(chars, curPos, size - curPos) … … 411 409 End Function 412 410 413 Const Function Operator [](i As Long) As StrChar411 Const Function Operator [](i As Long) As Char 414 412 Return Chars[i] 415 413 End Function 416 414 417 Sub Operator []=(i As Long, c As StrChar)415 Sub Operator []=(i As Long, c As Char) 418 416 Chars[i] = c 419 417 End Sub … … 431 429 End Sub 432 430 433 Const Function Chars(i As Long) As StrChar431 Const Function Chars(i As Long) As Char 434 432 If i >= Length Or i < 0 Then 435 433 Throw New IndexOutOfRangeException("StringBuilder.Chars: The index argument 'i' is out of range value.") … … 438 436 End Function 439 437 440 Sub Chars(i As Long, c As StrChar)438 Sub Chars(i As Long, c As Char) 441 439 If i >= Length Or i < 0 Then 442 440 Throw New ArgumentOutOfRangeException("StringBuilder.Chars: An argument is out of range value.", "i") … … 452 450 EnsureCapacity(i) 'iが適切な値かどうかの確認はこの中で行う 453 451 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) 455 453 End If 456 454 size = i … … 461 459 End Function 462 460 463 Function __Chars() As * StrChar461 Function __Chars() As *Char 464 462 Return chars 465 463 End Function … … 483 481 This.maxCapacity = maxCapacity 484 482 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)) 486 484 End Sub 487 485 … … 516 514 Sub separateBuffer() 517 515 If stringized Then 518 Dim newChars = GC_malloc_atomic(SizeOf ( StrChar) * capacity) As *StrChar516 Dim newChars = GC_malloc_atomic(SizeOf (Char) * capacity) As *Char 519 517 ActiveBasic.Strings.ChrCopy(newChars, chars, capacity As SIZE_T) 520 518 chars = newChars … … 523 521 End Sub 524 522 525 chars As * StrChar523 chars As *Char 526 524 maxCapacity As Long 527 525 capacity As Long … … 534 532 535 533 '暫定 536 Function StrPtr(sb As System.Text.StringBuilder) As * StrChar534 Function StrPtr(sb As System.Text.StringBuilder) As *Char 537 535 Return sb.__Chars 538 536 End Function -
trunk/Include/Classes/System/Xml/XmlDocument.ab
r463 r468 136 136 Save( fileStream ) 137 137 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 138 146 End Class 139 147 -
trunk/Include/Classes/System/misc.ab
r467 r468 1 1 ' Classes/System/misc.ab 2 3 #ifndef __SYSTEM_MISC_AB__4 #define __SYSTEM_MISC_AB__5 6 '#require <Classes/System/Threading/WaitHandle.ab>7 2 8 3 Namespace System … … 36 31 End Class 37 32 33 Delegate Sub EventHandler(sender As Object, e As EventArgs) 34 38 35 Delegate Sub AsyncCallback(ar As IAsyncResult) 39 36 40 41 37 End 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.