Changeset 388 for trunk/Include/Classes/System/Text/StringBuilder.ab
- Timestamp:
- Nov 25, 2007, 4:31:35 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/Classes/System/Text/StringBuilder.ab
r385 r388 128 128 Return This 129 129 Else 130 Throw New ArgumentNullException("StringBuilder.Append: An argument was null", "s")130 Throw New ArgumentNullException("StringBuilder.Append: An argument is null", "s") 131 131 End If 132 132 ElseIf startIndex < 0 Or count < 0 Then 133 Throw New ArgumentOutOfRangeException("StringBuilder.Append: One or more arguments have out of range value.", "startIndex or count or both")133 Throw New ArgumentOutOfRangeException("StringBuilder.Append: One or more arguments are out of range value.", "startIndex or count or both") 134 134 End If 135 135 appendCore(s, startIndex, count) … … 169 169 Const Sub CopyTo(sourceIndex As Long, ByRef dest[] As StrChar, destIndex As Long, count As Long) 170 170 If dest = 0 Then 171 Throw New ArgumentNullException("StringBuilder.CopyTo: An argument was null", "sourceIndex")171 Throw New ArgumentNullException("StringBuilder.CopyTo: An argument is null", "sourceIndex") 172 172 ElseIf size < sourceIndex + count Or sourceIndex < 0 Or destIndex < 0 Or count < 0 Then 173 Throw New ArgumentOutOfRangeException("StringBuilder.CopyTo: One or more arguments have out of range value.", "startIndex or count or both")173 Throw New ArgumentOutOfRangeException("StringBuilder.CopyTo: One or more arguments are out of range value.", "startIndex or count or both") 174 174 End If 175 175 … … 179 179 Function EnsureCapacity(c As Long) As Long 180 180 If c < 0 Or c > MaxCapacity Then 181 Throw New ArgumentOutOfRangeException("StringBuilder.Append: An argument was out of range value.", "c")181 Throw New ArgumentOutOfRangeException("StringBuilder.Append: An argument is out of range value.", "c") 182 182 ElseIf c > Capacity Then 183 183 Dim p = GC_malloc_atomic((c + 1) * SizeOf (StrChar)) As *StrChar … … 291 291 rangeCheck(index) 292 292 If n < 0 Then 293 Throw New ArgumentOutOfRangeException("StringBuilder.Insert: An argument was out of range value.", "n")293 Throw New ArgumentOutOfRangeException("StringBuilder.Insert: An argument is out of range value.", "n") 294 294 End If 295 295 Dim len = x.Length … … 310 310 rangeCheck(i) 311 311 If x = 0 Then 312 Throw New ArgumentNullException("StringBuilder.Insert: An argument was null", "x")312 Throw New ArgumentNullException("StringBuilder.Insert: An argument is null", "x") 313 313 ElseIf index < 0 Or count < 0 Then 314 Throw New ArgumentOutOfRangeException("StringBuilder.Append: One or more arguments have out of range value.", "index or count or both")314 Throw New ArgumentOutOfRangeException("StringBuilder.Append: One or more arguments are out of range value.", "index or count or both") 315 315 End If 316 316 … … 381 381 Sub replaceCore(oldStr As String, newStr As String, start As Long, count As Long) 382 382 If ActiveBasic.IsNothing(oldStr) Then 383 Throw New ArgumentNullException("StringBuilder.Replace: An argument was null", "oldStr")383 Throw New ArgumentNullException("StringBuilder.Replace: An argument is null", "oldStr") 384 384 ElseIf oldStr.Length = 0 Then 385 385 Throw New ArgumentException("StringBuilder.Replace: The argument 'oldStr' is empty string. ", "oldStr") … … 428 428 Sub Capacity(c As Long) 429 429 If c < size Or c > MaxCapacity Then 'sizeとの比較でcが負の場合も対応 430 Throw New ArgumentOutOfRangeException("StringBuilder. Append: An argument haveout of range value.", "c")430 Throw New ArgumentOutOfRangeException("StringBuilder.Capacity: An argument is out of range value.", "c") 431 431 End If 432 432 EnsureCapacity(c) … … 435 435 Const Function Chars(i As Long) As StrChar 436 436 If i >= Length Or i < 0 Then 437 Throw New IndexOutOfRangeException("StringBuilder.Chars: The index argument 'i' haveout of range value.")437 Throw New IndexOutOfRangeException("StringBuilder.Chars: The index argument 'i' is out of range value.") 438 438 End If 439 439 Return chars[i] … … 442 442 Sub Chars(i As Long, c As StrChar) 443 443 If i >= Length Or i < 0 Then 444 Throw New ArgumentOutOfRangeException("StringBuilder.Chars: An argument haveout of range value.", "i")444 Throw New ArgumentOutOfRangeException("StringBuilder.Chars: An argument is out of range value.", "i") 445 445 End If 446 446 chars[i] = c … … 474 474 Sub initialize(capacity As Long, maxCapacity = LONG_MAX As Long) 475 475 If capacity < 0 Or maxCapacity < 1 Or maxCapacity < capacity Then 476 Throw New ArgumentOutOfRangeException("StringBuilder constructor: One or more arguments have out of range value.", "capacity or maxCapacity or both")476 Throw New ArgumentOutOfRangeException("StringBuilder constructor: One or more arguments are out of range value.", "capacity or maxCapacity or both") 477 477 End If 478 478 … … 506 506 Sub rangeCheck(index As Long) 507 507 If index < 0 Or index > size Then 508 Throw New ArgumentOutOfRangeException("StringBuilder: Index argument has out of range value.")508 Throw New ArgumentOutOfRangeException("StringBuilder: Index argument is out of range value.") 509 509 End If 510 510 End Sub … … 517 517 'length < 0は判定に入っていないことに注意 518 518 If startIndex < 0 Or count < 0 Or startIndex + count > length Then 519 Throw New ArgumentOutOfRangeException("StringBuilder: One or more arguments have out of range value.", "startIndex or count or both")519 Throw New ArgumentOutOfRangeException("StringBuilder: One or more arguments are out of range value.", "startIndex or count or both") 520 520 End If 521 521 End Sub
Note:
See TracChangeset
for help on using the changeset viewer.