void SC_TerminalClient::pushCmdLine( SC_StringBuffer &buf, const char *newData, size_t size)
{
	lockInput();

	bool signal = false;

	while (size--) {
		char c = *newData++;
		switch (c) {
		case kRecompileLibrary:
		case kInterpretCmdLine:
		case kInterpretPrintCmdLine:
			mInputBuf.append( buf.getData(), buf.getSize() );
			mInputBuf.append(c);
			signal = true;
			buf.reset();
			break;

		default:
			buf.append(c);
		}
	}

	if(signal) sendSignal(sig_input);

	unlockInput();
}
void SC_TerminalClient::interpretCmdLine(PyrSymbol* method, SC_StringBuffer& cmdLine)
{
	setCmdLine(cmdLine);
	cmdLine.reset();
	runLibrary(method);
	flush();
}
Example #3
0
SC_StringBuffer::SC_StringBuffer(const SC_StringBuffer& other)
	: mCapacity(0), mPtr(0), mData(0)
{
	growBy(other.getSize());
	append(other.getData(), other.getSize());
}
void SC_LanguageClient::setCmdLine(const SC_StringBuffer& strBuf)
{
	setCmdLine(strBuf.getData(), strBuf.getSize());
}