forked from mirror/openmw-tes3mp
[General] Add vectorContains util for checking strings in vectors
This commit is contained in:
parent
84af9d9999
commit
c7f10892a9
2 changed files with 6 additions and 0 deletions
|
@ -90,6 +90,11 @@ bool Utils::vectorContains(std::vector<int>* vectorChecked, int value)
|
||||||
return std::find(vectorChecked->begin(), vectorChecked->end(), value) != vectorChecked->end();
|
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::string Utils::toString(int num)
|
||||||
{
|
{
|
||||||
std::ostringstream stream;
|
std::ostringstream stream;
|
||||||
|
|
|
@ -28,6 +28,7 @@ namespace Utils
|
||||||
bool compareDoubles(double a, double b, double epsilon);
|
bool compareDoubles(double a, double b, double epsilon);
|
||||||
|
|
||||||
bool vectorContains(std::vector<int>* vectorChecked, int value);
|
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);
|
std::string replaceString(const std::string &source, const char *find, const char *replace);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue