writing api for scratch buffer

This commit is contained in:
2021-07-09 16:57:34 +02:00
committed by Robin Mueller
parent 8980a696c9
commit bef73d7357
7 changed files with 89 additions and 0 deletions

View File

@ -0,0 +1,12 @@
#include "scratchApi.h"
ReturnValue_t scratch::writeString(std::string name, std::string string) {
std::ostringstream oss;
oss << "xsc_scratch write " << name << " \"" << string << "\"";
int result = std::system(oss.str().c_str());
if(result != 0) {
utility::handleSystemError(result, "scratch::String");
return HasReturnvaluesIF::RETURN_FAILED;
}
return HasReturnvaluesIF::RETURN_OK;
}