commit a98f5c6ac968aa89026e7c2aef8eb1e1188b6375
parent 3023710e83a51c21ff03df416b1c3296ce18046c
Author: Adam M <aemalone@gmail.com>
Date: Wed, 14 Nov 2018 21:31:41 -0600
need to debug it so I have to upload it to the internet...
Diffstat:
2 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/src/dtpulse.cpp b/src/dtpulse.cpp
@@ -129,7 +129,42 @@ std::vector<int> parseDt(std::string input, int offset, std::string lookup) {
}
return absoluteSequence;
}
+std::string splitRecur(std::string input) {
+ std::vector<std::string> outputVec;
+ std::string tempStack;
+ std::string output;
+ std::stringstream inputstream(input);
+ bool inside = false;
+ for(int i = 0; i < input.length(); i++) {
+ char c = input[i];
+ if(c == '(') {
+ tempStack = "";
+ inside = true;
+ }
+ else if(c == ')') {
+ outputVec.push_back(tempStack);
+ tempStack = "";
+ inside = false;
+ }
+ else {
+ // any other character
+ if(inside) {
+ tempStack += c;
+ }
+ else {
+ outputVec.push_back(c);
+ }
+ }
+
+ }
+ output = interleaveExpand(outputVec);
+ return output;
+}
+
std::string interleaveExpand(std::vector<std::string> blocks) {
+ // take a vector of strings and return a string interleave
+ // somewhat like bash shell expansion
+ // perhaps exactly like
std::vector<int> indices;
std::vector<int> lengths;
int outerIndex = 0;
diff --git a/src/dtpulse.hpp b/src/dtpulse.hpp
@@ -12,6 +12,7 @@ std::vector<int> parseEntireString(std::string input,std::string lookup, int typ
std::vector<int> parseStringAsValues(std::string input,std::string lookup);
std::vector<int> parseStringAsTimes(std::string input,std::string lookup);
void printVector(std::vector <int> intVector);
+std::string splitRecur(std::string input);
std::string interleaveExpand(std::vector<std::string> blocks);
std::string hashExpand(std::string input, int hashnum);
std::string atExpand(std::string input, int atnum, std::string lookup);