Changeset 73956 in vbox for trunk/src/VBox/Runtime/common/misc/json.cpp
- Timestamp:
- Aug 29, 2018 3:09:34 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/misc/json.cpp
r73930 r73956 1486 1486 } 1487 1487 1488 static int rtJsonIteratorBeginWorker(PRTJSONVALINT pThis, PRTJSONIT phJsonIt) 1489 { 1490 PRTJSONITINT pIt = (PRTJSONITINT)RTMemTmpAllocZ(sizeof(RTJSONITINT)); 1491 if (pIt) 1492 { 1493 RTJsonValueRetain(pThis); 1494 pIt->pJsonVal = pThis; 1495 pIt->idxCur = 0; 1496 1497 *phJsonIt = pIt; 1498 return VINF_SUCCESS; 1499 } 1500 return VERR_NO_MEMORY; 1501 } 1502 1488 1503 RTDECL(int) RTJsonIteratorBegin(RTJSONVAL hJsonVal, PRTJSONIT phJsonIt) 1489 1504 { … … 1491 1506 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 1492 1507 AssertPtrReturn(phJsonIt, VERR_INVALID_POINTER); 1493 1494 1508 RTJSON_TYPECHECK_CONTAINER_RETURN(pThis); 1495 1509 1496 PRTJSONITINT pIt = (PRTJSONITINT)RTMemTmpAllocZ(sizeof(RTJSONITINT)); 1497 if (RT_UNLIKELY(!pIt)) 1498 return VERR_NO_MEMORY; 1499 1500 RTJsonValueRetain(hJsonVal); 1501 pIt->pJsonVal = pThis; 1502 pIt->idxCur = 0; 1503 *phJsonIt = pIt; 1504 1505 return VINF_SUCCESS; 1510 return rtJsonIteratorBeginWorker(pThis, phJsonIt); 1511 } 1512 1513 RTDECL(int) RTJsonIteratorBeginArray(RTJSONVAL hJsonVal, PRTJSONIT phJsonIt) 1514 { 1515 PRTJSONVALINT pThis = hJsonVal; 1516 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 1517 AssertPtrReturn(phJsonIt, VERR_INVALID_POINTER); 1518 RTJSON_TYPECHECK_RETURN(pThis, RTJSONVALTYPE_ARRAY); 1519 1520 return rtJsonIteratorBeginWorker(pThis, phJsonIt); 1521 } 1522 1523 RTDECL(int) RTJsonIteratorBeginObject(RTJSONVAL hJsonVal, PRTJSONIT phJsonIt) 1524 { 1525 PRTJSONVALINT pThis = hJsonVal; 1526 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 1527 AssertPtrReturn(phJsonIt, VERR_INVALID_POINTER); 1528 RTJSON_TYPECHECK_RETURN(pThis, RTJSONVALTYPE_OBJECT); 1529 1530 return rtJsonIteratorBeginWorker(pThis, phJsonIt); 1506 1531 } 1507 1532
Note:
See TracChangeset
for help on using the changeset viewer.