From 0ece6f32016530c5039445d28540f90720824e71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=B4=A9=CA=9C=E1=B4=8F=C9=B4=E1=B4=87=E1=B4=85=CA=80?= =?UTF-8?q?=E1=B4=8F=C9=AA=E1=B4=85?= <73050054+PhoneDroid@users.noreply.github.com> Date: Tue, 11 Feb 2025 12:44:52 -0500 Subject: [PATCH] Base: [ Doxygen ] Improved parameter attribute methods (#19491) --- src/Base/Parameter.h | 52 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/src/Base/Parameter.h b/src/Base/Parameter.h index 92a9fcb7d4..3579b0d767 100644 --- a/src/Base/Parameter.h +++ b/src/Base/Parameter.h @@ -164,18 +164,64 @@ public: }; static const char* TypeName(ParamType type); static ParamType TypeValue(const char*); + + /** + * Sets the value of an attribute. + * + * @param[in] Type The type of the attribute. + * @param[in] Name The name of the attribute. + * @param[in] Value The value to be set. + */ void SetAttribute(ParamType Type, const char* Name, const char* Value); + + /** + * Removes an attribute. + * + * @param[in] Type The type of the attribute. + * @param[in] Name The name of the attribute. + */ void RemoveAttribute(ParamType Type, const char* Name); + + /** + * Returns the value of the attribute. + * + * If the attribute can't be found, \n + * the fallback value is returned. + * + * @param[in] Type The type of the attribute. + * @param[in] Name The name of the attribute. + * @param[out] Value The value of attribute or the fallback value. + * @param[in] Default The fallback value. + */ const char* GetAttribute(ParamType Type, const char* Name, std::string& Value, const char* Default) const; + + /** + * Returns all attributes with the given type. + * + * Optionally filters them to only include attributes \n + * with names that contain a certain string. + * + * @param[in] Type The type of attributes to be returned + * @param[in] sFilter String that has to be present in the names of the attributes. + * @returns Vector of attribute name & value pairs. + */ std::vector> GetAttributeMap(ParamType Type, const char* sFilter = nullptr) const; - /** Return the type and name of all parameters with optional filter - * @param sFilter only strings which name includes sFilter are put in the vector - * @return std::vector of pair(type, name) + + + /** + * Returns all parameters. + * + * Optionally filters them to only include attributes \n + * with names that contain a certain string. + * + * @param[in] sFilter String that has to be present in the names of the attributes. + * @returns Vector of attribute type & name pairs. */ std::vector> GetParameterNames(const char* sFilter = nullptr) const; + //@} /** @name methods for bool handling */