28 lines
691 B
C++
28 lines
691 B
C++
#ifndef UTIL_H
|
|
#define UTIL_H
|
|
|
|
#ifndef NULL
|
|
#define NULL ((void*)0)
|
|
#endif
|
|
|
|
#include <iostream>
|
|
#include <string>
|
|
#include <sstream>
|
|
#include <vector>
|
|
|
|
std::string intToString(int theInt);
|
|
std::string replaceExEscape(std::string first, std::string search, std::string replace);
|
|
std::string strSlice(std::string str, int begin, int end);
|
|
int findPerenEnd(std::string str, int i);
|
|
std::vector<std::string> split(const std::string &str, char delim);
|
|
std::string join(const std::vector<std::string> &strVec, std::string joinStr);
|
|
template <typename T>
|
|
bool contains(std::vector<T> vec, T item) {
|
|
for (auto i : vec)
|
|
if (i == item)
|
|
return true;
|
|
return false;
|
|
}
|
|
|
|
#endif
|