Initial
This commit is contained in:
48
http/EMIT.CPP
Normal file
48
http/EMIT.CPP
Normal file
@@ -0,0 +1,48 @@
|
||||
#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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user