Changeset 435
- Timestamp:
- Feb 28, 2008, 1:39:16 AM (17 years ago)
- Location:
- trunk/Include/Classes/System
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/Classes/System/Console.ab
r432 r435 36 36 */ 37 37 Static Function ReadLine() As String 38 ReadLine = in.ReadLine() 38 Dim lock = enter() 39 Try 40 ReadLine = in.ReadLine() 41 Finally 42 lock.Leave() 43 End Try 44 End Function 45 46 /* 47 @brief 標準入力から1行読み込む 48 @date 2008/02/26 49 @auther Egtra 50 */ 51 Static Function Read() As Long 52 Dim lock = enter() 53 Try 54 Read = in.Read() 55 Finally 56 lock.Leave() 57 End Try 39 58 End Function 40 59 Private 60 Function enter() As ActiveBasic.Windows.CriticalSectionLock 61 Imports ActiveBasic.Windows 62 If ActiveBasic.IsNothing(cs) Then 63 Dim lock = New CriticalSectionLock(_System_CriticalSection) 64 Try 65 If ActiveBasic.IsNothing(cs) Then 66 cs = New CriticalSection 67 End If 68 Finally 69 lock.Dispose() 70 End Try 71 End If 72 enter = cs.Enter 73 End Function 74 41 75 Static in = Nothing As IO.TextReader 76 Static cs = Nothing As ActiveBasic.Windows.CriticalSection 42 77 End Class 43 78 -
trunk/Include/Classes/System/Exception.ab
r411 r435 152 152 Return src 153 153 End Function 154 Protected 154 155 155 /*! 156 156 @brief HRESULT値の設定 -
trunk/Include/Classes/System/IO/Exception.ab
r391 r435 64 64 */ 65 65 Sub ThrowWinIOException(msg As String, error As DWord) 66 ' Throw IOException(msg, HRESULT_FROM_WIN32(error))66 Throw New IOException(msg, HRESULT_FROM_WIN32(error)) 67 67 End Sub 68 68 … … 74 74 */ 75 75 Sub ThrowWinLastErrorIOException(msg As String) 76 ' Throw IOException(msg, HRESULT_FROM_WIN32(GetLastError()))76 Throw New IOException(msg, HRESULT_FROM_WIN32(GetLastError())) 77 77 End Sub 78 78 End Namespace -
trunk/Include/Classes/System/IO/File.ab
r432 r435 27 27 28 28 Enum FileMode 29 Append = OPEN_ALWAYS30 Create = CREATE_ALWAYS31 CreateNew = CREATE_NEW32 Open = OPEN_EXISTING33 OpenOrCreate = OPEN_ALWAYS34 Truncate = TRUNCATE_EXISTING29 Append = 4 'OPEN_ALWAYS 30 Create = 2 'CREATE_ALWAYS 31 CreateNew = 1 'CREATE_NEW 32 Open = 3 'OPEN_EXISTING 33 OpenOrCreate = 4 'OPEN_ALWAYS 34 Truncate = 5 'TRUNCATE_EXISTING 35 35 End Enum 36 36 -
trunk/Include/Classes/System/IO/FileStream.ab
r432 r435 34 34 /* コンストラクタ.NETと同じように実装は難しい、一先ず動くものを実装したが変更が必要だと思う */ 35 35 Sub FileStream(path As String, mode As FileMode, access As FileAccess, share As FileShare, options As FileOptions) 36 If ActiveBasic.IsNothing(path) Then 37 Throw New ArgumentNullException("path") 38 ElseIf path.Length = 0 Then 39 Throw New ArgumentException 40 End If 41 42 36 43 Dim ac = access As DWord 37 44 Dim sh = share As DWord … … 49 56 'Throw System.IO.FileNotFoundException 50 57 This.handle=0 51 Beep(220,500)58 Detail.ThrowWinLastErrorIOException("Failed to open/create file.") 52 59 Exit Sub 53 60 End If -
trunk/Include/Classes/System/IO/StreamReader.ab
r432 r435 50 50 Override Function Read() As Long 51 51 Read = Peek() 52 cur++ 52 If Read <> -1 Then 53 cur++ 54 End If 53 55 End Function 54 56 -
trunk/Include/Classes/System/Text/StringBuilder.ab
r388 r435 387 387 388 388 Dim s = New StringBuilder(capacity, maxCapacity) 389 Dim curPos = 0 As Long 389 Dim curPos = start 390 Dim last = start + count 390 391 Do 391 392 Dim nextPos = ActiveBasic.Strings.ChrFind(VarPtr(chars[curPos]) As *StrChar, size As SIZE_T, StrPtr(oldStr), oldStr.Length As SIZE_T) As Long 392 If nextPos = -1 As SIZE_T Then 393 Exit Sub 393 If nextPos = -1 As SIZE_T Or curPos > last Then 394 s.appendCore(chars, curPos, size - curPos) 395 Exit Do 394 396 End If 395 397
Note:
See TracChangeset
for help on using the changeset viewer.