Files
Work/http/EMIT.CPP
2024-08-07 09:16:27 -04:00

49 lines
973 B
C++

#include <string.h>
#include <http/emit.hpp>
Emit::Emit(PureViewOfFile &inputView,PureViewOfFile &outputView)
: mIsEmitting(TRUE), mInputView(inputView), mOutputView(outputView)
{
}
Emit::~Emit()
{
}
void Emit::emit(int code,int type,int identifier)const
{
if(!mIsEmitting)return;
mOutputView.write(code);
mOutputView.write(type);
mOutputView.write(identifier);
}
void Emit::emit(int code,double value)const
{
if(!mIsEmitting)return;
mOutputView.write(code);
mOutputView.write(value);
}
void Emit::emit(int code,int op)const
{
if(!mIsEmitting)return;
mOutputView.write(code);
mOutputView.write(op);
}
void Emit::emit(const char *lpLiteralValue)const
{
if(!mIsEmitting||!lpLiteralValue)return;
mOutputView.write(String(lpLiteralValue));
}
void Emit::emit(const String &literalValue)const
{
if(!mIsEmitting||literalValue.isNull())return;
int stringLength(literalValue.length());
mOutputView.write(stringLength);
mOutputView.write(literalValue);
}