Basic structures work, prep work for function pointers and other stuff,a couple of bugs fixed.

This commit is contained in:
Nathan Braswell
2014-01-19 18:20:52 -05:00
parent b59fd26d4a
commit 62933af8f8
12 changed files with 95 additions and 25 deletions

View File

@@ -52,3 +52,22 @@ int findPerenEnd(std::string str, int i) {
return i;
}
}
std::vector<std::string> split(const std::string &str, char delim) {
std::stringstream ss(str);
std::string word;
std::vector<std::string> splitVec;
while (std::getline(ss, word, delim))
splitVec.push_back(word);
return splitVec;
}
std::string join(const std::vector<std::string> &strVec, std::string joinStr) {
if (strVec.size() == 0)
return "";
std::string joinedStr = strVec[0];
for (int i = 1; i < strVec.size(); i++)
joinedStr += joinStr + strVec[i];
return joinedStr;
}