libcamera: yaml_parser: Extend YamlObject::size() to dictionaries

Dictionaries have a size too, extend the size() function to support
them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
This commit is contained in:
Laurent Pinchart 2022-05-24 12:23:38 +03:00
parent 27483e971f
commit 27fb47f70b
3 changed files with 30 additions and 20 deletions

View file

@ -39,6 +39,8 @@ public:
return type_ == Type::Dictionary;
}
std::size_t size() const;
#ifndef __DOXYGEN__
template<typename T,
typename std::enable_if_t<
@ -53,7 +55,6 @@ public:
#endif
T get(const T &defaultValue, bool *ok = nullptr) const;
std::size_t size() const;
const YamlObject &operator[](std::size_t index) const;
bool contains(const std::string &key) const;