Changeset 391 for trunk/Include
- Timestamp:
- Dec 7, 2007, 12:21:58 AM (17 years ago)
- Location:
- trunk/Include
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/Classes/ActiveBasic/Strings/SPrintF.ab
r388 r391 818 818 819 819 Dim sb = New System.Text.StringBuilder 820 If sb.Length = &hfeeefeee Then Debug 820 821 With sb 821 822 Dim prefixFunc = tr.Prefix 822 823 Dim prefix = prefixFunc(x, flags) 823 824 sb.Append(prefix) 825 If sb.Length = &hfeeefeee Then Debug 824 826 825 827 Dim prefixLen = 0 As DWord … … 832 834 Dim bufStartPos = convertFunc(buf, x, flags) 833 835 836 If sb.Length = &hfeeefeee Then Debug 834 837 Dim len = (tr.MaxSize - bufStartPos) As Long 835 838 If len < 0 Then … … 841 844 842 845 .Append(buf, bufStartPos + 1, len) 846 If sb.Length = &hfeeefeee Then Debug 843 847 844 848 AdjustFieldWidth(sb, field, flags And (Not (Sign Or Blank)), prefixLen) 849 If sb.Length = &hfeeefeee Then Debug 845 850 End With 846 851 FormatIntegerEx = sb.ToString() -
trunk/Include/Classes/ActiveBasic/Strings/Strings.ab
r385 r391 199 199 200 200 Namespace Detail 201 Function Split(s As String, c As StrChar) As System.Collections. ArrayList202 Split = New System.Collections. ArrayList201 Function Split(s As String, c As StrChar) As System.Collections.Generic.List<String> 202 Split = New System.Collections.Generic.List<String> 203 203 204 204 Dim last = 0 As Long -
trunk/Include/Classes/System/Exception.ab
r385 r391 3 3 #require <Classes/ActiveBasic/misc.ab> 4 4 5 Namespace ActiveBasic 5 6 '右のコメントは対応するCOR_E_ナントカのコード 6 7 Const AB_E_EXCEPTION = &h80041500 '80131500 … … 12 13 Const AB_E_NOTSUPPORTED = &h80041515 '80131515 13 14 Const AB_E_PLATFORMNOTSUPPORTED = &h80041539 '80131539 15 16 End Namespace 14 17 15 18 /* … … 57 60 Sub Exception() 58 61 init(GetType().FullName, Nothing) 59 hr = A B_E_EXCEPTION62 hr = ActiveBasic.AB_E_EXCEPTION 60 63 End Sub 61 64 /*! … … 65 68 Sub Exception(message As String) 66 69 init(message, Nothing) 67 hr = A B_E_EXCEPTION70 hr = ActiveBasic.AB_E_EXCEPTION 68 71 End Sub 69 72 /*! … … 74 77 Sub Exception(message As String, innerException As Exception) 75 78 init(message, innerException) 76 hr = A B_E_EXCEPTION79 hr = ActiveBasic.AB_E_EXCEPTION 77 80 End Sub 78 81 … … 190 193 Sub SystemException() 191 194 Exception(GetType().FullName, Nothing) 192 HResult = A B_E_SYSTEM195 HResult = ActiveBasic.AB_E_SYSTEM 193 196 End Sub 194 197 /*! … … 198 201 Sub SystemException(message As String) 199 202 Exception(message, Nothing) 200 HResult = A B_E_SYSTEM203 HResult = ActiveBasic.AB_E_SYSTEM 201 204 End Sub 202 205 /*! … … 207 210 Sub SystemException(message As String, innerException As Exception) 208 211 Exception(message, innerException) 209 HResult = A B_E_SYSTEM212 HResult = ActiveBasic.AB_E_SYSTEM 210 213 End Sub 211 214 End Class … … 224 227 Sub ArgumentException() 225 228 SystemException("One or more arguments have invalid value.", Nothing) 226 HResult = A B_E_ARGUMENT229 HResult = ActiveBasic.AB_E_ARGUMENT 227 230 End Sub 228 231 /*! … … 232 235 Sub ArgumentException(message As String) 233 236 SystemException(message, Nothing) 234 HResult = A B_E_ARGUMENT237 HResult = ActiveBasic.AB_E_ARGUMENT 235 238 End Sub 236 239 /*! … … 241 244 Sub ArgumentException(message As String, innerException As Exception) 242 245 SystemException(message, innerException) 243 HResult = A B_E_ARGUMENT246 HResult = ActiveBasic.AB_E_ARGUMENT 244 247 End Sub 245 248 /*! … … 251 254 SystemException(message, Nothing) 252 255 param = paramName 253 HResult = A B_E_ARGUMENT256 HResult = ActiveBasic.AB_E_ARGUMENT 254 257 End Sub 255 258 /*! … … 262 265 SystemException(message, innerException) 263 266 param = paramName 264 HResult = A B_E_ARGUMENT267 HResult = ActiveBasic.AB_E_ARGUMENT 265 268 End Sub 266 269 … … 337 340 Sub ArgumentOutOfRangeException() 338 341 ArgumentException("One or more arguments ware out of range value.", "", Nothing) 339 HResult = A B_E_ARGUMENTOUTOFRANGE342 HResult = ActiveBasic.AB_E_ARGUMENTOUTOFRANGE 340 343 End Sub 341 344 /*! … … 345 348 Sub ArgumentOutOfRangeException(message As String) 346 349 ArgumentException(message, "", Nothing) 347 HResult = A B_E_ARGUMENTOUTOFRANGE350 HResult = ActiveBasic.AB_E_ARGUMENTOUTOFRANGE 348 351 End Sub 349 352 /*! … … 354 357 Sub ArgumentOutOfRangeException(message As String, innerException As Exception) 355 358 ArgumentException(message, "", innerException) 356 HResult = A B_E_ARGUMENTOUTOFRANGE359 HResult = ActiveBasic.AB_E_ARGUMENTOUTOFRANGE 357 360 End Sub 358 361 /*! … … 363 366 Sub ArgumentOutOfRangeException(message As String, paramName As String) 364 367 ArgumentException(message, paramName, Nothing) 365 HResult = A B_E_ARGUMENTOUTOFRANGE368 HResult = ActiveBasic.AB_E_ARGUMENTOUTOFRANGE 366 369 End Sub 367 370 /*! … … 374 377 ArgumentException(message, paramName, Nothing) 375 378 actualValueObject = actualValue 376 HResult = A B_E_ARGUMENTOUTOFRANGE379 HResult = ActiveBasic.AB_E_ARGUMENTOUTOFRANGE 377 380 End Sub 378 381 … … 411 414 Sub IndexOutOfRangeException() 412 415 SystemException("The index was out of range value.", Nothing) 413 HResult = A B_E_INDEXOUTOFRANGE416 HResult = ActiveBasic.AB_E_INDEXOUTOFRANGE 414 417 End Sub 415 418 /*! … … 419 422 Sub IndexOutOfRangeException(message As String) 420 423 SystemException(message, Nothing) 421 HResult = A B_E_INDEXOUTOFRANGE424 HResult = ActiveBasic.AB_E_INDEXOUTOFRANGE 422 425 End Sub 423 426 /*! … … 428 431 Sub IndexOutOfRangeException(message As String, innerException As Exception) 429 432 SystemException(message, innerException) 430 HResult = A B_E_INDEXOUTOFRANGE433 HResult = ActiveBasic.AB_E_INDEXOUTOFRANGE 431 434 End Sub 432 435 End Class … … 445 448 Sub InvalidOperationException() 446 449 SystemException("The operation is invalid.", Nothing) 447 HResult = A B_E_INVALIDOPERATION450 HResult = ActiveBasic.AB_E_INVALIDOPERATION 448 451 End Sub 449 452 /*! … … 453 456 Sub InvalidOperationException(message As String) 454 457 SystemException(message, Nothing) 455 HResult = A B_E_INVALIDOPERATION458 HResult = ActiveBasic.AB_E_INVALIDOPERATION 456 459 End Sub 457 460 /*! … … 462 465 Sub InvalidOperationException(message As String, innerException As Exception) 463 466 SystemException(message, innerException) 464 HResult = AB_E_INVALIDOPERATION 465 End Sub 467 HResult = ActiveBasic.AB_E_INVALIDOPERATION 468 End Sub 469 End Class 470 471 /*! 472 @brief 博されたオブジェクトを操作しようとしたことを表す例外 473 @author Egtra 474 @date 2007/12/06 475 */ 476 Class ObjectDisposedException 477 Inherits InvalidOperationException 478 Public 479 /*! 480 @biref コンストラクタ 481 */ 482 Sub ObjectDisposedException() 483 InvalidOperationException("The object has been disposed.", Nothing) 484 HResult = ActiveBasic.AB_E_INVALIDOPERATION 485 End Sub 486 /*! 487 @biref コンストラクタ 488 @param[in] message エラーメッセージ 489 */ 490 Sub ObjectDisposedException(message As String) 491 InvalidOperationException(message, Nothing) 492 HResult = ActiveBasic.AB_E_INVALIDOPERATION 493 End Sub 494 /*! 495 @biref コンストラクタ 496 @param[in] message エラーメッセージ 497 @param[in] innerException 内部例外 498 */ 499 Sub ObjectDisposedException(message As String, innerException As Exception) 500 InvalidOperationException(message, innerException) 501 HResult = ActiveBasic.AB_E_INVALIDOPERATION 502 End Sub 503 /*! 504 @biref コンストラクタ 505 @param[in] objectName 操作しようとしたオブジェクトの名前 506 @param[in] message エラーメッセージ 507 */ 508 Sub ObjectDisposedException(objectName As String, message As String) 509 InvalidOperationException(message, Nothing) 510 HResult = ActiveBasic.AB_E_INVALIDOPERATION 511 objName = " object: " + objectName 512 End Sub 513 /*! 514 @brief この例外が発生したとき、操作しようとしていたオブジェクトの名前を返す。 515 */ 516 Function ObjectName() As String 517 Return objName 518 End Function 519 520 Override Function ToString() As String 521 ToString = Super.ToString() 522 If Not ActiveBasic.IsNothing(objName) Then 523 ToString += objName 524 End If 525 End Function 526 Private 527 objName As String 466 528 End Class 467 529 … … 513 575 Sub NotSupportedException() 514 576 SystemException("This operation is not supported,", Nothing) 515 HResult = A B_E_NOTSUPPORTED577 HResult = ActiveBasic.AB_E_NOTSUPPORTED 516 578 End Sub 517 579 /*! … … 521 583 Sub NotSupportedException(message As String) 522 584 SystemException(message, Nothing) 523 HResult = A B_E_NOTSUPPORTED585 HResult = ActiveBasic.AB_E_NOTSUPPORTED 524 586 End Sub 525 587 /*! … … 530 592 Sub NotSupportedException(message As String, innerException As Exception) 531 593 SystemException(message, innerException) 532 HResult = A B_E_NOTSUPPORTED594 HResult = ActiveBasic.AB_E_NOTSUPPORTED 533 595 End Sub 534 596 End Class … … 547 609 Sub PlatformNotSupportedException() 548 610 NotSupportedException("This operation is not supported in this platform.", Nothing) 549 HResult = A B_E_PLATFORMNOTSUPPORTED611 HResult = ActiveBasic.AB_E_PLATFORMNOTSUPPORTED 550 612 End Sub 551 613 /*! … … 555 617 Sub PlatformNotSupportedException(message As String) 556 618 NotSupportedException(message, Nothing) 557 HResult = A B_E_PLATFORMNOTSUPPORTED619 HResult = ActiveBasic.AB_E_PLATFORMNOTSUPPORTED 558 620 End Sub 559 621 /*! … … 564 626 Sub PlatformNotSupportedException(message As String, innerException As Exception) 565 627 NotSupportedException(message, innerException) 566 HResult = A B_E_PLATFORMNOTSUPPORTED628 HResult = ActiveBasic.AB_E_PLATFORMNOTSUPPORTED 567 629 End Sub 568 630 End Class -
trunk/Include/Classes/System/IO/FileStream.ab
r388 r391 4 4 /* ほんとはmiscに入れるかかファイルを分けたほうがいいかもしれないが一先ず実装 */ 5 5 Enum FileOptions 6 Asynchronous7 DeleteOnClose8 Encrypted9 None10 RandomAccess 11 SequentialScan 12 WriteThrough 6 None = 0 7 Asynchronous = FILE_FLAG_OVERLAPPED 8 DeleteOnClose = FILE_FLAG_DELETE_ON_CLOSE 9 Encrypted = FILE_ATTRIBUTE_ENCRYPTED 10 RandomAccess = FILE_FLAG_RANDOM_ACCESS 11 SequentialScan = FILE_FLAG_SEQUENTIAL_SCAN 12 WriteThrough = FILE_FLAG_WRITE_THROUGH 13 13 End Enum 14 14 … … 75 75 End Select 76 76 77 Select Case options 78 Case FileOptions.Asynchronous 79 op=FILE_FLAG_OVERLAPPED 80 Case FileOptions.DeleteOnClose 81 op=FILE_FLAG_DELETE_ON_CLOSE 82 Case FileOptions.Encrypted 83 Case FileOptions.None 84 op=0 85 Case FileOptions.RandomAccess 86 op=FILE_FLAG_RANDOM_ACCESS 87 Case FileOptions.SequentialScan 88 op=FILE_FLAG_SEQUENTIAL_SCAN 89 Case FileOptions.WriteThrough 90 op=FILE_FLAG_WRITE_THROUGH 91 End Select 92 93 This.handle=CreateFile(path As PSTR,ac,sh,ByVal NULL,mo,op,0) 77 op = options As DWord 78 If Not Environment.OSVersion.Platform = PlatformID.Win32NT Then 79 op And= Not FILE_FLAG_OVERLAPPED 80 End If 81 82 This.handle=CreateFile(ToTCStr(path),ac,sh,ByVal NULL,mo,op,0) 94 83 If This.handle=INVALID_HANDLE_VALUE Then 95 84 'エラー処理 … … 134 123 End Sub 135 124 Public 125 /*! 126 @brief ファイルが読み込みに対応しているかを返す 127 */ 136 128 Override Function CanRead() As Boolean 137 /* ファイルが読み込みに対応しているかを返す */138 129 If This.fileAccess And GENERIC_READ Then 139 130 Return True … … 143 134 End Function 144 135 136 /*! 137 @brief ファイルがシークに対応しているかを返す 138 */ 145 139 Override Function CanSeek() As Boolean 146 /* ファイルがシークに対応しているかを返す */147 140 If GetFileType(This.handle)=FILE_TYPE_DISK Then 148 141 Return True … … 157 150 ' End Function*/ 158 151 152 /*! 153 @brief ファイルが書き込みに対応しているかを返す 154 */ 159 155 Override Function CanWrite() As Boolean 160 /* ファイルが書き込みに対応しているかを返す */161 156 If This.fileAccess And GENERIC_WRITE Then 162 157 Return True … … 168 163 /*Handle*/ 169 164 165 /*! 166 @brief ファイルが非同期操作に対応しているかを返す 167 */ 170 168 Function IsAsync() As Boolean 171 /* ファイルが非同期操作に対応しているかを返す */172 169 If This.fileOptions And FILE_FLAG_OVERLAPPED /*FileOptions.Asynchronous*/ Then 173 170 Return True … … 178 175 179 176 Override Function Length() As Int64 177 disposedCheck() 180 178 If This.CanSeek() Then 181 Dim length As LARGE_INTEGER 182 length.LowPart=GetFileSize(This.handle,VarPtr(length.HighPart) As *DWord) 183 Return MAKEQWORD(length.LowPart,length.HighPart) As Int64 179 Dim length = VarPtr(Length) As *ULARGE_INTEGER 180 length->LowPart = GetFileSize(This.handle, VarPtr(length->HighPart)) 181 If LODWORD(Length) = INVALID_FILE_SIZE Then 182 Dim error = GetLastError() 183 If error <> NO_ERROR Then 184 ' Detail.ThrowWinIOException("FileStream.Read: Failed to read.", error) 185 End If 186 End If 187 188 If Length < 0 Then 189 Debug 'Throw OverflowException 190 End If 184 191 End If 185 192 End Function … … 190 197 191 198 Override Sub Position(value As Int64) 199 disposedCheck() 192 200 If This.CanSeek() Then 193 201 If This.IsAsync() Then … … 202 210 End Sub 203 211 Override Function Position() As Int64 212 disposedCheck() 204 213 If This.CanSeek() Then 205 214 If This.IsAsync() Then … … 266 275 267 276 Override Sub Flush() 268 FlushFileBuffers(This.handle) 277 disposedCheck() 278 Dim ret = FlushFileBuffers(This.handle) 279 If ret = FALSE Then 280 ' Detail.ThrowWinLastErrorIOException("FileStream.Read: Failed to read.") 281 End If 269 282 End Sub 270 283 … … 273 286 End Function*/ 274 287 275 Override Function GetHashCode() As Long276 Return ObjPtr(This) As Long277 End Function278 279 288 /* GetLifetimeService*/ 280 289 … … 286 295 287 296 Sub Lock(position As Int64, length As Int64) 297 disposedCheck() 288 298 If position < 0 Then 289 299 Throw New ArgumentOutOfRangeException("FileStream.Lock: An argument is negative value.", New System.Int64(position), "position") … … 296 306 297 307 Override Function Read( buffer As *Byte, offset As Long, count As Long) As Long 298 If This.CanRead() Then 299 Dim readBytes As DWord 300 If This.IsAsync() Then 301 Dim overlapped As OVERLAPPED 302 SetQWord(VarPtr(overlapped.Offset), offset) 303 Dim ret = ReadFile(This.handle, VarPtr(buffer[offset]), count, 0, overlapped) 308 disposedCheck() 309 If buffer = 0 Then 310 ' Throw ArgumentNullException("FileStream.Read: An argument is null value.", "buffer") 311 ElseIf Not This.CanRead() Then 312 ' Throw NotSupportedException("FileStream.Read: This stream is not readable.") 313 End If 314 315 Dim ret As BOOL 316 Dim readBytes As DWord 317 If This.IsAsync() Then 318 Dim overlapped As OVERLAPPED 319 SetQWord(VarPtr(overlapped.Offset), offset) 320 overlapped.hEvent = CreateEvent(0, TRUE, FALSE, 0) 321 If overlapped.hEvent = 0 Then 322 ' Throw OutOfMemoryException("FileStream.Read: Failed to create an event object.") 323 End If 324 Try 325 ret = ReadFile(This.handle, VarPtr(buffer[offset]), count, 0, overlapped) 304 326 If ret = FALSE Then 305 If GetLastError() = ERROR_IO_PENDING Then 306 GetOverlappedResult(This.handle, overlapped, readBytes, TRUE) 327 Dim error = GetLastError() 328 If error <> ERROR_IO_PENDING Then 329 ' Detail.ThrowWinIOException("FileStream.Read: Failed to read.", error) 307 330 End If 308 331 End If 332 ret = GetOverlappedResult(This.handle, overlapped, readBytes, TRUE) 333 If ret = FALSE Then 334 ' Detail.ThrowWinLastErrorIOException("FileStream.Read: Failed to read.") 335 End If 309 336 offset += Read 310 Else 311 ReadFile(This.handle,VarPtr(buffer[offset]),count,VarPtr(readBytes),ByVal NULL) 312 End If 313 Read = readBytes As Long 314 End If 315 End Function 316 317 /* ReferenceEquals*/ 318 319 Override Function Seek(offset As Int64, origin As SeekOrigin) As Long 337 Finally 338 CloseHandle(overlapped.hEvent) 339 End Try 340 Else 341 ret = ReadFile(This.handle,VarPtr(buffer[offset]),count,VarPtr(readBytes),ByVal NULL) 342 If ret = FALSE Then 343 ' Detail.ThrowWinLastErrorIOException("FileStream.Read: Failed to read.") 344 End If 345 End If 346 Read = readBytes As Long 347 End Function 348 349 /*! 350 @brief ストリームの現在位置を移動させる。 351 @param[in] offset originからの移動量 352 @param[in] origin 移動の基準位置 353 @return 移動後の新しい現在位置 354 @exception DisposedException 既にストリームが閉じられている場合 355 @exception ArgumentException 移動後の位置が負の位置(ファイル先頭より手前)になる場合 356 @exception IOException その他エラーが発生した場合 357 */ 358 Override Function Seek(offset As Int64, origin As SeekOrigin) As Int64 359 disposedCheck() 320 360 If This.CanSeek() Then 321 361 If This.IsAsync() Then … … 328 368 This.offset = This.Length + offset 329 369 End Select 370 Seek = This.offset As Int64 371 If Seek < 0 Then 372 ' Throw ArgumentException("FileStream.Seek: Cannot seek to negative offset.") 373 End If 330 374 Else 331 Dim seek As LARGE_INTEGER 332 seek.LowPart=LODWORD(offset) 333 seek.HighPart=HIDWORD(offset) 334 Select Case origin 335 Case SeekOrigin.Begin 336 Return SetFilePointer(This.handle,seek.LowPart,VarPtr(seek.HighPart) As *DWord,FILE_BEGIN) 337 Case SeekOrigin.Current 338 Return SetFilePointer(This.handle,seek.LowPart,VarPtr(seek.HighPart) As *DWord,FILE_CURRENT) 339 Case SeekOrigin.End 340 Return SetFilePointer(This.handle,seek.LowPart,VarPtr(seek.HighPart) As *DWord,FILE_CURRENT) 341 End Select 375 Dim seek = VarPtr(offset) As *ULARGE_INTEGER 376 Dim ret = SetFilePointer(This.handle, seek->LowPart, VarPtr(seek->HighPart), origin As DWord) 377 If ret = INVALID_SET_FILE_POINTER Then 378 Dim error = GetLastError() 379 If error = ERROR_NEGATIVE_SEEK Then 380 ' Throw ArgumentException("FileStream.Seek: Cannot seek to negative offset.") 381 ElseIf error <> NO_ERROR Then 382 ' Throw Detail.ThrowWinIOException("FileStream.Seek: Failed to seek.", error) 383 End If 384 End If 385 seek->LowPart = ret 386 Seek = offset 342 387 End If 343 388 End If … … 349 394 350 395 Override Sub SetLength(value As Int64) 396 disposedCheck() 351 397 If This.CanWrite() and This.CanSeek() Then 352 398 If This.IsAsync() Then … … 354 400 Dim current = This.Position() 355 401 This.Position(value) 356 SetEndOfFile(This.handle) 402 Dim ret = SetEndOfFile(This.handle) 403 If ret = FALSE Then 404 Detail.ThrowWinLastErrorIOException("FileStream.Read: Failed to read.") 405 End If 406 Position = current 357 407 End If 358 408 End If … … 366 416 367 417 Sub Unlock(position As Int64, length As Int64) 418 disposedCheck() 368 419 If position < 0 Then 369 420 Throw New ArgumentOutOfRangeException("FileStream.Lock: An argument is negative value.", New System.Int64(position), "position") … … 371 422 Throw New ArgumentOutOfRangeException("FileStream.Lock: An argument is negative value.", New System.Int64(length), "length") 372 423 End If 373 UnlockFile(handle, LODWORD(position As QWord), HIDWORD(position As QWord),424 Dim ret = UnlockFile(handle, LODWORD(position As QWord), HIDWORD(position As QWord), 374 425 LODWORD(length As QWord), HIDWORD(length As QWord)) 375 End Sub 376 426 If ret = FALSE Then 427 Detail.ThrowWinLastErrorIOException("FileStream.Read: Failed to read.") 428 End If 429 End Sub 377 430 378 431 Override Sub Write(buffer As *Byte, offset As Long, count As Long) 432 disposedCheck() 379 433 If This.CanWrite() Then 380 434 Dim writeBytes As DWord … … 382 436 Dim overlapped As OVERLAPPED 383 437 SetQWord(VarPtr(overlapped.Offset), offset) 438 overlapped.hEvent = CreateEvent(0, TRUE, FALSE, 0) 384 439 Dim ret = WriteFile(This.handle, VarPtr(buffer[offset]), count, 0, overlapped) 385 If ret = FALSE Then 386 If GetLastError() = ERROR_IO_PENDING Then 387 GetOverlappedResult(This.handle, overlapped, writeBytes, TRUE) 388 End If 440 If ret <> FALSE Or GetLastError() = ERROR_IO_PENDING Then 441 GetOverlappedResult(This.handle, overlapped, writeBytes, TRUE) 389 442 End If 390 443 offset += writeBytes 444 CloseHandle(overlapped.hEvent) 391 445 Else 392 446 WriteFile(This.handle, VarPtr(buffer[offset]), count, VarPtr(writeBytes), ByVal NULL) … … 394 448 End If 395 449 End Sub 396 397 450 398 451 Protected … … 405 458 End Function 406 459 407 /* Dispose408 Finalize409 MemberwiseClone*/410 460 Private 461 Sub disposedCheck() 462 If handle = 0 Then 463 ' Throw ObjectDisposedException("FileStream: This stream has closed.") 464 End If 465 End Sub 466 411 467 End Class 412 468 -
trunk/Include/Classes/System/IO/Stream.ab
r388 r391 70 70 End Function 71 71 72 Abstract Function Seek(offset As Int64, origin As SeekOrigin) As Long72 Abstract Function Seek(offset As Int64, origin As SeekOrigin) As Int64 73 73 Abstract Sub SetLength(value As Int64) 74 74 Abstract Sub Write(buffer As *Byte, offset As Long, count As Long) -
trunk/Include/Classes/System/IO/misc.ab
r318 r391 1 1 2 TypeDef /* [Delegate] */ AsyncCallback = *Sub(ByRef ar As System.IAsyncResult) 2 Namespace System 3 Namespace IO 3 4 4 5 Enum SeekOrigin 5 Begin 6 Current 7 End 6 Begin = FILE_BEGIN 7 Current = FILE_CURRENT 8 End = FILE_END 8 9 End Enum 9 10 … … 12 13 TopDirectoryOnly 13 14 End Enum 15 16 End Namespace 'IO 17 End Namespace 'System -
trunk/Include/Classes/System/String.ab
r388 r391 347 347 Const Function Contains(s As String) As Boolean 348 348 If Object.ReferenceEquals(s, Nothing) Then 349 Throw New ArgumentNullException("String.Contains: An argument is out of rangevalue.", "s")349 Throw New ArgumentNullException("String.Contains: An argument is null value.", "s") 350 350 ElseIf s = "" Then 351 351 Return True -
trunk/Include/Classes/System/misc.ab
r261 r391 11 11 ' Properties 12 12 Function AsyncState() As Object 13 Function AsyncWaitHandle() As System.Threading.WaitHandle13 Function AsyncWaitHandle() As Threading.WaitHandle 14 14 Function CompletedSynchronously() As Boolean 15 15 Function IsCompleted() As Boolean … … 36 36 End Class 37 37 38 'Delegate Sub AsyncCallback(ar As IAsyncResult) 39 Delegate Sub AsyncCallback(ar As VoidPtr) 40 41 38 42 End Namespace 'System 39 43 #require <Classes/System/Threading/WaitHandle.ab> -
trunk/Include/Classes/index.ab
r388 r391 58 58 #require "./System/IO/DirectorySecurity.ab" 59 59 #require "./System/IO/DriveInfo.ab" 60 #require "./System/IO/Exception.ab" 60 61 #require "./System/IO/File.ab" 61 62 #require "./System/IO/FileInfo.ab" -
trunk/Include/basic/command.sbp
r364 r391 158 158 159 159 Dim i = 0 As Long 160 Dim i2 As Long, i3 As Long 161 Dim buffer = New System.Text.StringBuilder(GetFileSize(_System_hFile[FileNumber], 0) + 1) 160 Dim buffer = New System.Text.StringBuilder(256) 162 161 Dim temp[1] As StrChar 163 162 Dim dwAccessBytes As DWord … … 167 166 '次のデータをサーチ 168 167 Do 169 i2=ReadFile(_System_hFile[FileNumber],temp,SizeOf (StrChar),VarPtr(dwAccessBytes),ByVal 0)170 If i2=0 or dwAccessBytes=0 Then168 Dim ret = ReadFile(_System_hFile[FileNumber],temp,SizeOf (StrChar),VarPtr(dwAccessBytes),ByVal 0) 169 If ret=0 or dwAccessBytes=0 Then 171 170 'error 172 171 Exit Macro … … 176 175 177 176 '読み込み 178 i3=-1179 177 IsStr=0 180 178 While 1 181 i3++ 182 183 i2=ReadFile(_System_hFile[FileNumber],temp,SizeOf (StrChar),VarPtr(dwAccessBytes),ByVal 0) 184 If i2=0 or (i3=0 and dwAccessBytes=0) Then 179 Dim ret = ReadFile(_System_hFile[FileNumber],temp,SizeOf (StrChar),VarPtr(dwAccessBytes),ByVal 0) 180 If ret = 0 or dwAccessBytes = 0 Then 185 181 'error 186 182 Exit Macro … … 188 184 If temp[0]=34 Then IsStr=IsStr xor 1 189 185 190 buffer [i3]=temp[0]186 buffer.Append(temp[0]) 191 187 If dwAccessBytes=0 or temp[0]=0 or temp[0]=13 or temp[0]=10 or (IsStr=0 and temp[0]=Asc(",")) or (IsStr=0 and (temp[0]=32 or temp[0]=9) and _System_InputDataType[i]<>_System_Type_String) Then 192 188 If temp[0]=13 Then … … 210 206 End If 211 207 212 buffer [i3]=0208 buffer.Append(0 As StrChar) 213 209 Exit While 214 210 End If -
trunk/Include/basic/dos_console.sbp
r293 r391 40 40 Goto *InputReStart 41 41 End If 42 _System_Input_SetArgument(_System_InputDataPtr[i], _System_InputDataType[i], broken[i] .ToString)42 _System_Input_SetArgument(_System_InputDataPtr[i], _System_InputDataType[i], broken[i]) 43 43 Next 44 44 -
trunk/Include/system/debug.sbp
r389 r391 29 29 End Function 30 30 31 /*! 32 @brief デバッグ用Set_LONG_PTR。 33 削除すると、ABプログラムが正常にデバッグ実行できなくなる。 34 */ 31 35 Sub _DebugSys_Set_LONG_PTR(pPtr As VoidPtr, lpData As LONG_PTR) 32 36 #ifdef _WIN64
Note:
See TracChangeset
for help on using the changeset viewer.