From c3ff273a2238a07833efb2523e7af3c965e25114 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Thu, 26 Jul 2018 20:01:58 +0300 Subject: [PATCH] [General] Add getVectorSize() and resetVector() to Utils --- components/openmw-mp/Utils.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/components/openmw-mp/Utils.hpp b/components/openmw-mp/Utils.hpp index b70e621e2..98850c1ae 100644 --- a/components/openmw-mp/Utils.hpp +++ b/components/openmw-mp/Utils.hpp @@ -37,6 +37,19 @@ namespace Utils return std::find(vectorChecked.begin(), vectorChecked.end(), value) != vectorChecked.end(); } + template + uint32_t getVectorSize(const std::vector &vectorChecked) + { + return static_cast(vectorChecked.size()); + } + + template + void resetVector(std::vector &vectorInput, uint32_t newSize) + { + vectorInput.clear(); + vectorInput.resize(newSize); + } + std::string replaceString(const std::string &source, const char *find, const char *replace); std::string toString(int num);