#pragma XOD dirtieness disable
node {
char* result;
CStringView view;
void evaluate(Context ctx) {
auto str = getValue<input_CHR>(ctx);
unsigned char chr = *(str.iterate());
size_t len = getValue<input_LEN>(ctx);
result = new char[len + 1];
view = CStringView(result);
memset(result, chr, len);
result[len] = '\0';
emitValue<output_STR>(ctx, XString(&view));
}
}
CHR | LEN | STR |
---|---|---|
"#" | 2 | "##" |
"*" | 3 | "***" |
"x" | 4 | "xxxx" |
"Hello" | 5 | "HHHHH" |