00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "OutStreams.h"
00011
00012 void OutText::writeString(const char* value, PhysicalOutStream& stream)
00013 {
00014 char c=' ';
00015 stream.writeToStream(&c,1);
00016 for(; *value; ++value)
00017 {
00018 if(*value == ' ')
00019 sprintf(buf,"\\ ");
00020 else if(*value == '\n')
00021 sprintf(buf,"\\\n");
00022 else if(*value == '\r')
00023 sprintf(buf,"\\\r");
00024 else if(*value == '\t')
00025 sprintf(buf,"\\\t");
00026 else if(*value == '\\')
00027 sprintf(buf,"\\\\");
00028 else
00029 sprintf(buf,"%c",*value);
00030
00031 stream.writeToStream(buf,(int)strlen(buf));
00032 }
00033 }
00034
00035 void OutText::writeData(const void *p,int size, PhysicalOutStream& stream)
00036 {
00037 for(int i = 0; i < size; ++i)
00038 writeChar(*((const char*&) p)++, stream);
00039 }
00040
00041 void OutTextRaw::writeString(const char* value, PhysicalOutStream& stream)
00042 {
00043 stream.writeToStream(value,(int)strlen(value));
00044 }
00045
00046 void OutTextRaw::writeData(const void *p,int size, PhysicalOutStream& stream)
00047 {
00048 for(int i = 0; i < size; ++i)
00049 writeChar(*((const char*&) p)++, stream);
00050 }
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087