Changeset 237 for Include/Classes/System/String.ab
- Timestamp:
- May 7, 2007, 4:22:52 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/Classes/System/String.ab
r227 r237 184 184 185 185 Static Function CompareOrdinal(x As String, indexX As Long, y As String, indexY As Long, length As Long) As Long 186 If x = NothingThen187 If y = NothingThen186 If Object.ReferenceEquals(x, Nothing) Then 187 If Object.ReferenceEquals(y, Nothing) Then 188 188 Return 0 189 189 Else 190 190 Return -1 191 191 End If 192 ElseIf y = NothingThen192 ElseIf Object.ReferenceEquals(y, Nothing) Then 193 193 Return 1 194 194 End If 195 Return _System_StrCmpN(VarPtr(x.Chars[indexX]), VarPtr(y.Chars[indexY]), length )195 Return _System_StrCmpN(VarPtr(x.Chars[indexX]), VarPtr(y.Chars[indexY]), length As SIZE_T) 196 196 End Function 197 197 … … 344 344 #ifdef __STRING_IS_NOT_UNICODE 345 345 With Concat 346 Dim lenA = MultiByteToWideChar(CP_THREAD_ACP, 0, text, len, 0, 0, 0, 0)346 Dim lenA = WideCharToMultiByte(CP_THREAD_ACP, 0, text, len, 0, 0, 0, 0) 347 347 .AllocStringBuffer(m_Length + lenA) 348 348 memcpy(.Chars, This.Chars, m_Length) 349 MultiByteToWideChar(CP_THREAD_ACP, 0, text, len, VarPtr(.Chars[m_Length]), lenA, 0, 0)349 WideCharToMultiByte(CP_THREAD_ACP, 0, text, len, VarPtr(.Chars[m_Length]), lenA, 0, 0) 350 350 .Chars[m_Length + lenA] = 0 351 351 End With … … 473 473 temp.AllocStringBuffer(length) 474 474 memcpy(temp.Chars, VarPtr(Chars[startIndex]), SizeOf (StrChar) * length) 475 Chars[m_Length] = 0475 temp.Chars[m_Length] = 0 476 476 Return temp 477 477 End Function … … 527 527 End Function 528 528 529 Const Function Replace(oldStr As *StrChar, newStr As *StrChar) 529 Const Function Replace(oldStr As *StrChar, newStr As *StrChar) As String 530 530 If oldStr = 0 Then Debug 'Throw ArgumentNullException 531 531 If newStr = 0 Then newStr = "" 532 Return ReplaceCore(oldStr, lstrlen(oldStr), newStr, lstrlen(newStr)) As String532 Return ReplaceCore(oldStr, lstrlen(oldStr), newStr, lstrlen(newStr)) 533 533 End Function 534 534
Note:
See TracChangeset
for help on using the changeset viewer.