#include "GoClientUser.h" #include <stdio.h> GoClientUser::GoClientUser() : editFs(0), errorPause(), inputData(), outputError(), outputInfo(), outputText() { } void GoClientUser::clear() { errorPause.Clear(); errorPause.Terminate(); inputData.Clear(); inputData.Terminate(); outputError.Clear(); outputError.Terminate(); outputInfo.Clear(); outputInfo.Terminate(); outputText.Clear(); outputText.Terminate(); } FileSys * GoClientUser::getEditFs() { return editFs; } const char * GoClientUser::getErrorPause() { return errorPause.Text(); } const char * GoClientUser::getOutputError() { return outputError.Text(); } const char * GoClientUser::getOutputInfo() { return outputInfo.Text(); } const char * GoClientUser::getOutputText() { return outputText.Text(); } void GoClientUser::setInputData(const char *data) { // fprintf(stderr, "setInputData\n"); inputData.Append(data); } void GoClientUser::Edit(FileSys *fs, Error *e) { fprintf(stderr, "Edit\n"); editFs = fs; } void GoClientUser::ErrorPause(char *buf, Error *e) { fprintf(stderr, "ErrorPause\n%s\n", buf); errorPause.Append(buf); } void GoClientUser::Finished() { // fprintf(stderr, "Finished\n"); } void GoClientUser::HandleError(Error *e) { StrBuf errBuf; e->Fmt(&errBuf); outputError.Append(errBuf.Text()); // fprintf(stderr, "HandleError\n%s\n", errBuf.Text()); } void GoClientUser::Help(const char * const * help) { for (int ii = 0; help[ii] != 0; ++ii) { fprintf(stderr, "help: %s\n", help[ii]); } } void GoClientUser::OutputBinary(const char *buf, int length) { fprintf(stderr, "OutputBinary\n"); } void GoClientUser::OutputInfo(char level, const char *data) { // fprintf(stderr, "output info:%s\n", data); outputInfo.Append(data); outputInfo.Append("\n"); } void GoClientUser::OutputText(const char *buf, int length) { fprintf(stderr, "output text ... %s\n", buf); outputText.Append(buf); } void GoClientUser::InputData(StrBuf *buf, Error *e) { // fprintf(stderr, "InputData\n"); buf->Append(inputData.Text()); } void GoClientUser::Prompt(const StrPtr &msg, StrBuf &rsp, int noEcho, Error *e) { fprintf(stderr, "Prompt %s", msg.Text()); }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 10513 | tjuricek |
A basic experiment with using the C++ API in Go May not work completely. I haven't messed with this in over a year. The Go tools may have come a long ways as well, and we may be able to automate things more directly in the typical toolkit then having to use node. |