From patchwork Tue Jan 13 00:07:50 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 25738 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 9FD9BBDCBF for ; Tue, 13 Jan 2026 00:08:59 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5969E61FC8; Tue, 13 Jan 2026 01:08:59 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="t0ZWsMyl"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2F18061FC8 for ; Tue, 13 Jan 2026 01:08:58 +0100 (CET) Received: from pendragon.ideasonboard.com (81-175-209-152.bb.dnainternet.fi [81.175.209.152]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 4073EBCA for ; Tue, 13 Jan 2026 01:08:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1768262912; bh=FdsClevNyNQuTBJXJy7gOR1uROX9L0CA1y+LtpZ8j7c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=t0ZWsMylLt5+E0JElhJtncbuVz/R+TsH/YUcgB+jyksANGHJJSwj+b77Bz3W0NdNm GNYQ/+3IubMKy7pPetNSxrDJajlnTnpnrHQObF/ak8npDdc9S6+1PKEhJUrhsSPKNN Oxp4ub/fTgUYknx6lBuRBMeHVWGLBwqXYds2c6DI= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH 18/36] libcamera: yaml_object: Miscellaneous documentation improvements Date: Tue, 13 Jan 2026 02:07:50 +0200 Message-ID: <20260113000808.15395-19-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20260113000808.15395-1-laurent.pinchart@ideasonboard.com> References: <20260113000808.15395-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Fix a few documentation issues: - Drop unneeded \fn - Sort \brief and \tparam correctly - Add missing \tparam and \param - Explain the T and U template parameters for get() - Standardize the naming of dictionary keys as "key" - Fix typo Signed-off-by: Laurent Pinchart --- src/libcamera/yaml_object.cpp | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/libcamera/yaml_object.cpp b/src/libcamera/yaml_object.cpp index 5e92189fdb8e..4328ccbff8f1 100644 --- a/src/libcamera/yaml_object.cpp +++ b/src/libcamera/yaml_object.cpp @@ -81,7 +81,6 @@ YamlObject::~YamlObject() = default; */ /** - * \fn YamlObject::size() * \brief Retrieve the number of elements in a dictionary or list YamlObject * * This function retrieves the size of the YamlObject, defined as the number of @@ -104,8 +103,8 @@ std::size_t YamlObject::size() const /** * \fn template YamlObject::get() const - * \tparam T Type of the value * \brief Parse the YamlObject as a \a T value + * \tparam T Type of the value * * This function parses the value of the YamlObject as a \a T object, and * returns the value. If parsing fails (usually because the YamlObject doesn't @@ -120,11 +119,14 @@ std::size_t YamlObject::size() const /** * \fn template YamlObject::get(U &&defaultValue) const * \brief Parse the YamlObject as a \a T value + * \tparam T Type of the value + * \tparam U Type of the default value * \param[in] defaultValue The default value when failing to parse * * This function parses the value of the YamlObject as a \a T object, and * returns the value. If parsing fails (usually because the YamlObject doesn't - * store a \a T value), the \a defaultValue is returned. + * store a \a T value), the \a defaultValue is returned. Type \a U must be + * convertible to type \a T. * * Unlike the get() function, this overload does not support std::vector for the * type \a T. @@ -135,6 +137,7 @@ std::size_t YamlObject::size() const /** * \fn template YamlObject::set(T &&value) * \brief Set the value of a YamlObject + * \tparam T Type of the value * \param[in] value The value * * This function sets the value stored in a YamlObject to \a value. The value is @@ -363,8 +366,8 @@ template struct YamlObject::Accessor>; */ /** - * \fn YamlObject::operator[](std::size_t index) const * \brief Retrieve the element from list YamlObject by index + * \param[in] index The element index * * This function retrieves an element of the YamlObject. Only YamlObject * instances of List type associate elements with index, calling this function @@ -382,13 +385,13 @@ const YamlObject &YamlObject::operator[](std::size_t index) const } /** - * \fn YamlObject::contains() * \brief Check if an element of a dictionary exists + * \param[in] key The element key * - * This function check if the YamlObject contains an element. Only YamlObject - * instances of Dictionary type associate elements with names, calling this - * function on other types of instances is invalid and results in undefined - * behaviour. + * This function check if the YamlObject contains an element for the given \a + * key. Only YamlObject instances of Dictionary type associate elements with + * keys, calling this function on other types of instances is invalid and + * results in undefined behaviour. * * \return True if an element exists, false otherwise */ @@ -398,11 +401,11 @@ bool YamlObject::contains(std::string_view key) const } /** - * \fn YamlObject::operator[](std::string_view key) const - * \brief Retrieve a member by name from the dictionary + * \brief Retrieve a member by key from the dictionary + * \param[in] key The element key * - * This function retrieve a member of a YamlObject by name. Only YamlObject - * instances of Dictionary type associate elements with names, calling this + * This function retrieves a member of a YamlObject by \a key. Only YamlObject + * instances of Dictionary type associate elements with keys, calling this * function on other types of instances or with a nonexistent key results in an * empty object. *