Changeset 175 for Include/com/bstring.ab
- Timestamp:
- Mar 21, 2007, 7:06:34 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/com/bstring.ab
r142 r175 66 66 Sub AssignFromBStr(bstr As BSTR) 67 67 Clear() 68 BString(bstr)68 String.Copy(bs, bstr) 69 69 End Sub 70 71 Const Function Copy() As BSTR 72 BString.Copy(Copy, bs) 73 End Function 70 74 71 75 Sub Clear() … … 78 82 Sub Attach(bstr As BSTR) 79 83 Clear() 80 bs = bstr84 BString.Move(bs, bstr) 81 85 End Sub 82 86 83 87 Function Detach() As BSTR 84 Detach = bs 85 bs = 0 88 BString.Move(Detach, bs) 86 89 End Function 87 90 … … 113 116 114 117 Override Function ToString() As String 115 Dim s As String(bs , Length)118 Dim s As String(bs As PCWSTR, Length As Long) 116 119 Return s 120 End Function 121 122 Override Function GetHashCode() As Long 123 Return _System_GetHashFromWordArray(bs, Length) 117 124 End Function 118 125 119 126 Private 120 127 bs As BSTR 128 129 Static Sub Copy(ByRef dst As BSTR, ByVal src As BSTR) 130 dst = SysAllocStringLen(src, SysStringLen(src)) 131 End Sub 132 133 Static Sub Move(ByRef dst As BSTR, ByRef src As BSTR) 134 dst = src 135 src = 0 136 End Sub 121 137 End Class 122 138
Note:
See TracChangeset
for help on using the changeset viewer.