Changeset 386
- Timestamp:
- Nov 23, 2007, 11:39:44 AM (17 years ago)
- Location:
- trunk/Include
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/Classes/ActiveBasic/Strings/SPrintF.ab
r385 r386 1205 1205 */ 1206 1206 Function SPrintf(format As String, params As *Object, n As SIZE_T) As String 1207 Dim i = 0 As DWord1207 Dim i = 0 As SIZE_T 1208 1208 Dim paramsCount = 0 As SIZE_T 1209 1209 Dim fmt = StrPtr(format) … … 1211 1211 Do 1212 1212 Dim last = format.Length - (((fmt - StrPtr(format)) \ SizeOf (StrChar)) As LONG_PTR) As Long 'po 1213 Dim pos = ActiveBasic.Strings.ChrFind(fmt, last, &h25 As StrChar) '&h25 = %1213 Dim pos = ActiveBasic.Strings.ChrFind(fmt, last, &h25 As StrChar) As Long '&h25 = % 1214 1214 If pos = -1 Then 1215 1215 s.Append(fmt, 0, last) … … 1270 1270 s.Append(FormatString(params[i] As String, precision, fieldWidth, flags)) 1271 1271 Case &h63 'c 1272 s.Append(FormatCharacter(params[i] As BoxedStrChar, precision, fieldWidth, flags) )1272 s.Append(FormatCharacter(params[i] As BoxedStrChar, precision, fieldWidth, flags) As Char) 1273 1273 ' Case &h6e 'n 1274 1274 Case &h25 '% … … 1299 1299 param4 As Object, param5 As Object, param6 As Object, 1300 1300 param7 As Object, param8 As Object, param9 As Object) As String 1301 #ifdef _WIN64 1302 'コンパイラがどういうコードを吐くのかわからないので、安全策を取る。 1303 Dim params[9] = [param0, param1, param2, param3, param4, 1304 param5, param6, param7, param8, param9] As Object 1305 #else 1301 1306 1302 Dim params = VarPtr(param0) As *Object 1307 #endif 1303 1308 1304 SPrintf = ActiveBasic.Strings.Detail.SPrintf(format, params, 10) 1309 1305 End Function … … 1321 1317 param4 As Object, param5 As Object, param6 As Object, 1322 1318 param7 As Object, param8 As Object) As String 1323 #ifdef _WIN64 1324 Dim params[8] = [param0, param1, param2, param3, param4, 1325 param5, param6, param7, param8] As Object 1326 #else 1319 1327 1320 Dim params = VarPtr(param0) As *Object 1328 #endif 1321 1329 1322 SPrintf = ActiveBasic.Strings.Detail.SPrintf(format, params, 9) 1330 1323 End Function … … 1342 1335 param4 As Object, param5 As Object, param6 As Object, 1343 1336 param7 As Object) As String 1344 #ifdef _WIN64 1345 Dim params[7] = [param0, param1, param2, param3, param4, 1346 param5, param6, param7] As Object 1347 #else 1337 1348 1338 Dim params = VarPtr(param0) As *Object 1349 #endif 1339 1350 1340 SPrintf = ActiveBasic.Strings.Detail.SPrintf(format, params, 8) 1351 1341 End Function … … 1362 1352 param1 As Object, param2 As Object, param3 As Object, 1363 1353 param4 As Object, param5 As Object, param6 As Object) As String 1364 #ifdef _WIN64 1365 Dim params[6] = [param0, param1, param2, param3, param4, 1366 param5, param6] As Object 1367 #else 1354 1368 1355 Dim params = VarPtr(param0) As *Object 1369 #endif 1356 1370 1357 SPrintf = ActiveBasic.Strings.Detail.SPrintf(format, params, 7) 1371 1358 End Function … … 1382 1369 param1 As Object, param2 As Object, param3 As Object, 1383 1370 param4 As Object, param5 As Object) As String 1384 #ifdef _WIN64 1385 Dim params[5] = [param0, param1, param2, param3, param4, 1386 param5] As Object 1387 #else 1371 1388 1372 Dim params = VarPtr(param0) As *Object 1389 #endif 1373 1390 1374 SPrintf = ActiveBasic.Strings.Detail.SPrintf(format, params, 6) 1391 1375 End Function … … 1402 1386 param1 As Object, param2 As Object, param3 As Object, 1403 1387 param4 As Object) As String 1404 #ifdef _WIN64 1405 Dim params[4] = [param0, param1, param2, param3, param4] As Object 1406 #else 1388 1407 1389 Dim params = VarPtr(param0) As *Object 1408 #endif 1390 1409 1391 SPrintf = ActiveBasic.Strings.Detail.SPrintf(format, params, 5) 1410 1392 End Function … … 1420 1402 Function SPrintf(format As String, param0 As Object, 1421 1403 param1 As Object, param2 As Object, param3 As Object) As String 1422 #ifdef _WIN64 1423 Dim params[3] = [param0, param1, param2, param3] As Object 1424 #else 1404 1425 1405 Dim params = VarPtr(param0) As *Object 1426 #endif 1406 1427 1407 SPrintf = ActiveBasic.Strings.Detail.SPrintf(format, params, 4) 1428 1408 End Function … … 1438 1418 Function SPrintf(format As String, param0 As Object, 1439 1419 param1 As Object, param2 As Object) As String 1440 #ifdef _WIN64 1441 Dim params[2] = [param0, param1, param2] As Object 1442 #else 1420 1443 1421 Dim params = VarPtr(param0) As *Object 1444 #endif 1422 1445 1423 SPrintf = ActiveBasic.Strings.Detail.SPrintf(format, params, 3) 1446 1424 End Function … … 1456 1434 Function SPrintf(format As String, param0 As Object, 1457 1435 param1 As Object) As String 1458 #ifdef _WIN64 1459 Dim params[1] = [param0, param1] As Object 1460 #else 1436 1461 1437 Dim params = VarPtr(param0) As *Object 1462 #endif 1438 1463 1439 SPrintf = ActiveBasic.Strings.Detail.SPrintf(format, params, 2) 1464 1440 End Function -
trunk/Include/Classes/System/Collections/ArrayList.ab
r381 r386 7 7 8 8 Class ArrayList 9 Implements IList /*, ICollection, IEnumerable, ICloneable*/9 'Implements IList /*, ICollection, IEnumerable, ICloneable*/ 10 10 11 11 pObject As *Object … … 76 76 End Function 77 77 78 /*Const*/ OverrideFunction IsFixedSize() As Boolean78 /*Const*/ Function IsFixedSize() As Boolean 79 79 Return False 80 80 End Function 81 81 82 /*Const*/ OverrideFunction IsReadOnly() As Boolean82 /*Const*/ Function IsReadOnly() As Boolean 83 83 Return False 84 84 End Function … … 219 219 End Function 220 220 221 /*Const*/ OverrideFunction IndexOf(object As Object) As Long221 /*Const*/ Function IndexOf(object As Object) As Long 222 222 Return IndexOf(object, 0, size) 223 223 End Function … … 238 238 End Function 239 239 240 OverrideSub Insert(i As Long, object As Object)240 Sub Insert(i As Long, object As Object) 241 241 SetLeastCapacity(size + 1) 242 242 memmove(VarPtr(pObject[i + 1]), VarPtr(pObject[i]), SizeOf (*Object) * (size - i)) … … 261 261 End Function 262 262 263 OverrideSub Remove(object As Object)263 Sub Remove(object As Object) 264 264 Dim i = IndexOf(object) 265 265 If i > 0 Then … … 268 268 End Sub 269 269 270 OverrideSub RemoveAt(i As Long)270 Sub RemoveAt(i As Long) 271 271 RemoveRange(i, 1) 272 272 End Sub … … 307 307 End Sub 308 308 309 /*Override*/Override Function ToString() As String309 Override Function ToString() As String 310 310 Return "System.Collections.ArrayList" 311 311 End Function -
trunk/Include/Classes/System/Collections/Generic/List.ab
r352 r386 5 5 6 6 Class List<T> 7 Implements IEnumerable, IEnumerator 7 8 items As *T 8 9 size As Long 10 11 currentIndexForEnumerator As Long 9 12 10 13 Sub Realloc( allocateSize As Long ) … … 125 128 size-- 126 129 End Sub 130 131 /*! 132 @brief IEnumeratorインターフェイスを取得する 133 @author Daisuke Yamamoto 134 @date 2007/11/19 135 @return IEnumeratorインターフェイスが返る 136 */ 137 Function GetEnumerator() As IEnumerator 138 Return This 139 End Function 140 141 /*! 142 @brief イテレータのカレントインデックスを増加させる 143 @author Daisuke Yamamoto 144 @date 2007/11/19 145 @return 上限に達していなければTrueが、達していればFalseが返る 146 */ 147 Function MoveNext() As Boolean 148 If currentIndexForEnumerator >= size Then 149 ' 上限に達した 150 Return False 151 End If 152 153 currentIndexForEnumerator ++ 154 Return True 155 End Function 156 157 /*! 158 @brief イテレータをリセットする 159 @author Daisuke Yamamoto 160 @date 2007/11/19 161 */ 162 Sub Reset() 163 currentIndexForEnumerator = 0 164 End Sub 165 166 /*! 167 @brief イテレータのカレントオブジェクトを取得する 168 @author Daisuke Yamamoto 169 @date 2007/11/19 170 @return カレントオブジェクトが返る 171 */ 172 Function Current() As Object 173 Return items[currentIndexForEnumerator] As Object 174 End Function 127 175 End Class 128 176 -
trunk/Include/Classes/System/Collections/misc.ab
r355 r386 49 49 Interface IEnumerable 50 50 ' Method 51 ' Function GetEnumerator() As *IEnumerator51 Function GetEnumerator() As IEnumerator 52 52 End Interface 53 53 … … 57 57 Sub Reset() 58 58 ' Property 59 Function Current() As *Object59 Function Current() As Object 60 60 End Interface 61 61 -
trunk/Include/system/string.sbp
r385 r386 9 9 10 10 Function StrPtr(s As String) As *StrChar 11 If ActiveBasic.IsNothing(s) Then11 If Not ActiveBasic.IsNothing(s) Then 12 12 StrPtr = s.StrPtr 13 13 End If
Note:
See TracChangeset
for help on using the changeset viewer.