Files
clover/aruco_pose/src/util.h
Oleg Kalachev 2ec6930099 aruco_pose: undocumented possibility to set custom markers board
parameters:
~type=custom
~markers
2018-03-06 02:40:35 +03:00

21 lines
540 B
C++

#pragma once
#include <vector>
#include <string>
std::vector<std::string> strSplit(const std::string& str, const std::string& delim)
{
std::vector<std::string> tokens;
size_t prev = 0, pos = 0;
do
{
pos = str.find(delim, prev);
if (pos == std::string::npos) pos = str.length();
std::string token = str.substr(prev, pos-prev);
if (!token.empty()) tokens.push_back(token);
prev = pos + delim.length();
}
while (pos < str.length() && prev < str.length());
return tokens;
}