[General] Add vectorContains util for checking strings in vectors

This commit is contained in:
David Cernat 2018-06-28 04:50:01 +03:00
parent 84af9d9999
commit c7f10892a9
2 changed files with 6 additions and 0 deletions

View file

@ -90,6 +90,11 @@ bool Utils::vectorContains(std::vector<int>* vectorChecked, int value)
return std::find(vectorChecked->begin(), vectorChecked->end(), value) != vectorChecked->end();
}
bool Utils::vectorContains(std::vector<std::string>* vectorChecked, std::string value)
{
return std::find(vectorChecked->begin(), vectorChecked->end(), value) != vectorChecked->end();
}
std::string Utils::toString(int num)
{
std::ostringstream stream;

View file

@ -28,6 +28,7 @@ namespace Utils
bool compareDoubles(double a, double b, double epsilon);
bool vectorContains(std::vector<int>* vectorChecked, int value);
bool vectorContains(std::vector<std::string>* vectorChecked, std::string value);
std::string replaceString(const std::string &source, const char *find, const char *replace);