From c5bc468ab9f0f16ad1739d153c45d921f70fe6be Mon Sep 17 00:00:00 2001 From: Ruakij Date: Mon, 22 Nov 2021 11:31:13 +0100 Subject: [PATCH] Added documentation to find --- helper/find.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/helper/find.hpp b/helper/find.hpp index 2a1c6cb..e08c530 100644 --- a/helper/find.hpp +++ b/helper/find.hpp @@ -4,6 +4,7 @@ #include #include +/// @brief Internal function void prepare(const int &size, int &start, const int &offset, int &end){ // Set missing fields if(!end) end = size; @@ -15,6 +16,13 @@ void prepare(const int &size, int &start, const int &offset, int &end){ end -= offset; } +/// @brief Find str-index based on contains-content +/// @param data is the vector-string-data to search +/// @param strContains string to find +/// @param start where to start searching +/// @param offset search offset to position (results in index being shifted by -offset) +/// @param end where to end searching +/// @return index of found index (with offset if any) int findContains(const std::vector &data, const std::string &strContains, int start = 0, int offset = 0, int end = 0){ prepare(data.size(), start, offset, end); @@ -25,6 +33,13 @@ int findContains(const std::vector &data, const std::string &strCon return -1; } +/// @brief Find str-index based on exact-content +/// @param data is the vector-string-data to search +/// @param strIs string to find (exact) +/// @param start where to start searching +/// @param offset search offset to position (results in index being shifted by -offset) +/// @param end where to end searching +/// @return index of found index (with offset if any) int findIs(const std::vector &data, const std::string &strIs, int start = 0, int offset = 0, int end = 0){ prepare(data.size(), start, offset, end);