Last change
on this file since 44 was 44, checked in by dai, 17 years ago |
Indent/Unindentに対応してみた。Assertの骨組みを書いたので、後ほど細かい実装をしたい(コールスタック、どうしよう…)。
|
File size:
955 bytes
|
Line | |
---|
1 | Class Trace
|
---|
2 | Static IndentNum = 0 As Long
|
---|
3 |
|
---|
4 | Static Function GetIndentString() As String
|
---|
5 | Dim i As Long
|
---|
6 | Dim ResultStr = ""
|
---|
7 | For i = 0 To ELM( IndentNum )
|
---|
8 | ResultStr = ResultStr + Ex"\t"
|
---|
9 | Next
|
---|
10 | Return ResultStr
|
---|
11 | End Function
|
---|
12 | Public
|
---|
13 |
|
---|
14 | /*
|
---|
15 | TODO: 実装
|
---|
16 |
|
---|
17 | ' アサート表示
|
---|
18 | Static Sub Assert( condition As Boolean )
|
---|
19 | If condition == False then
|
---|
20 | 'TODO: コールスタックを表示
|
---|
21 | End If
|
---|
22 | End Sub
|
---|
23 | Static Sub Assert( condition As Boolean, message As String )
|
---|
24 | If condition == False then
|
---|
25 | WriteLine( message )
|
---|
26 | End If
|
---|
27 | End Sub
|
---|
28 | */
|
---|
29 |
|
---|
30 | ' インデントレベルを上げる
|
---|
31 | Static Sub Indent()
|
---|
32 | IndentNum++
|
---|
33 | End Sub
|
---|
34 |
|
---|
35 | ' インデントレベルを下げる
|
---|
36 | Static Sub Unindent()
|
---|
37 | If IndentNum <= 0 Then
|
---|
38 | IndentNum = 0
|
---|
39 | Return
|
---|
40 | End If
|
---|
41 | IndentNum--
|
---|
42 | End Sub
|
---|
43 |
|
---|
44 | ' 一行の文字列を出力
|
---|
45 | Static Sub WriteLine( message As String )
|
---|
46 | Dim tempmsg = GetIndentString() + message + Ex"\n"
|
---|
47 | OutputDebugString( tempmsg )
|
---|
48 | End Sub
|
---|
49 | End Class
|
---|
Note:
See
TracBrowser
for help on using the repository browser.