fix (hack): Pass lines as array to cloud stream

Rather than a single multi-line string. This hack will have to do
until we implement multi-line strings in the parser.
This commit is contained in:
John Colvin committed 2023-10-25 17:42:59 -04:00
1 parent 81ea106ce3
commit dcac260efe
1 file changed
+13 -5
@@ -8,17 +8,25 @@ namespace BCG
{
private readonly string _name, _stream_exp;
private StreamOffloadRequestor _requestor = new StreamOffloadRequestor();
public AddToCloudStream(string name, string stream_exp)
: this(name, stream_exp, 0)
public AddToCloudStream(string name, params string[] lines)
: this(name, 0, lines)
{
}
public AddToCloudStream(string name, string stream_exp, int persist)
public AddToCloudStream(string name, int persist, params string[] lines)
{
_name = name;
_stream_exp = stream_exp;
_stream_exp = getExpression(lines);
_requestor.add_to_cloud(_name, _stream_exp, persist == 1);
mySetRealSource(new TableStream("cloud_streams"));
}
static string getExpression(params string[] lines) {
for (int i = 0; i < lines.Length; i++) {
// unescape quotes
lines[i] = lines[i].Replace("\\\"", "\"");
}
return string.Join("\n", lines);
}
}
}
}