mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 07:19:45 +03:00
libcamera: yaml_parser: Add getList() function
Allow to retrieve a YAML list of any already supported types in a std::vector. Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com> Tested-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
b4cbb5c388
commit
02e387e7b6
3 changed files with 75 additions and 0 deletions
|
@ -518,6 +518,12 @@ protected:
|
|||
return TestFail;
|
||||
}
|
||||
|
||||
const auto &values = firstElement.getList<uint16_t>();
|
||||
if (!values || values->size() != 2 || (*values)[0] != 1 || (*values)[1] != 2) {
|
||||
cerr << "getList() failed to return correct vector" << std::endl;
|
||||
return TestFail;
|
||||
}
|
||||
|
||||
auto &secondElement = level2Obj[1];
|
||||
if (!secondElement.isDictionary() ||
|
||||
!secondElement.contains("one") ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue