From: Vsevolod Stakhov Date: Thu, 17 Aug 2023 11:35:34 +0000 (+0100) Subject: [Minor] Fix some docs X-Git-Tag: 3.7.1~76^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=87c6b54923fb5bc8105d5adecf33b5f7fa926d65;p=rspamd.git [Minor] Fix some docs --- diff --git a/src/libutil/cxx/util.hxx b/src/libutil/cxx/util.hxx index 4ec1d568c..32ec0b55c 100644 --- a/src/libutil/cxx/util.hxx +++ b/src/libutil/cxx/util.hxx @@ -40,6 +40,15 @@ constexpr auto array_of(Ts &&...t) -> std::array(t)...}}; } +/** + * Find a value in a map + * @tparam C Map type + * @tparam K Key type + * @tparam V Value type + * @param c Map to search + * @param k Key to search + * @return Value if found or std::nullopt otherwise + */ template && std::is_constructible_v, bool> = false> constexpr auto find_map(const C &c, const K &k) -> std::optional> { @@ -93,17 +102,18 @@ inline auto string_foreach_line(const S &input, const F &functor) /** * Iterate over elements in a string - * @tparam S - * @tparam F - * @param input - * @param delim - * @param functor - * @param ignore_empty - * @return + * @tparam S string type + * @tparam D delimiter type + * @tparam F functor type + * @param input string to iterate + * @param delim delimiter to use + * @param functor functor to call + * @param ignore_empty ignore empty elements + * @return nothing */ template && std::is_constructible_v && std::is_constructible_v, bool> = true> -inline auto string_foreach_delim(const S &input, const D &delim, const F &functor, const bool ignore_empty = true) +inline auto string_foreach_delim(const S &input, const D &delim, const F &functor, const bool ignore_empty = true) -> void { size_t first = 0; auto sv_input = std::string_view{input}; @@ -124,6 +134,13 @@ inline auto string_foreach_delim(const S &input, const D &delim, const F &functo } } +/** + * Split string on a character + * @tparam S string type + * @param input string to split + * @param chr character to split on + * @return pair of strings + */ template, bool> = true> inline auto string_split_on(const S &input, std::string_view::value_type chr) -> std::pair { @@ -144,6 +161,10 @@ inline auto string_split_on(const S &input, std::string_view::value_type chr) -> /** * Enumerate for range loop + * @tparam T iterable type + * @tparam TIter iterator type + * @param iterable iterable object + * @return iterator object */ template())),