26 #ifndef NVNEURAL_SCRIPTENGINEUTILS_H
27 #define NVNEURAL_SCRIPTENGINEUTILS_H
37 int indexOf(
const std::vector<T>& values,
const T& name)
39 const size_t pos = size_t(std::find(values.begin(), values.end(), name) - values.begin());
40 if (pos >= values.size())
50 std::string trim(
const std::string& s);
51 std::vector<std::string>
split(
const std::string& strToSplit,
char delimeter,
bool skipEmpty);
52 std::string join(
const std::vector<std::string>& arr,
const std::string& delimiter);
54 std::vector<uint8_t> fromHex(
const std::string& hex);
56 std::string restyleLayerName(
const std::string& name);
58 float convertStringToFloat(
const std::string& str,
const float def_value = 0.0f);
60 unsigned int roundUp(
unsigned int nominator,
unsigned int denominator);
64 size_t x = 1, y = 1, z = 1;
69 explicit SizeValue(
const SizeValue& v);
70 explicit SizeValue(
size_t _x,
size_t _y = 1,
size_t _z = 1);
71 explicit SizeValue(
const std::string& value);
75 bool fromString(
const std::string& v,
size_t fill = 1);
76 bool operator==(
const SizeValue& val)
const;
77 bool operator!=(
const SizeValue& val)
const;
79 std::string toString()
const;
83 int toInt(
const std::string& v);
std::vector< std::string > split(std::string strToSplit, char delimiter, bool skip_empty=false)
Splits a string by a delimiter, returns a vector of the split strings.
Definition: CoreHelpers.h:155