00001
00002 #line 1 "OW_XMLEscape.re"
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00037
00038 #include "OW_config.h"
00039 #include "OW_XMLEscape.hpp"
00040 #include "OW_StringBuffer.hpp"
00041
00042 namespace OW_NAMESPACE
00043 {
00044
00045 String XMLEscape(const char* escapedText, unsigned len)
00046 {
00047 StringBuffer rval(len * 2);
00048 const char* begin = escapedText;
00049 #define YYCTYPE char
00050 #define YYCURSOR begin
00051 #define YYLIMIT begin
00052 #define YYFILL(n)
00053 start:
00054 {
00055 YYCTYPE yych;
00056 goto yy0;
00057 ++YYCURSOR;
00058 yy0:
00059 if (YYLIMIT == YYCURSOR) YYFILL(1);
00060 yych = *YYCURSOR;
00061 switch (yych){
00062 case '\000': goto yy20;
00063 case '\t': goto yy16;
00064 case '\n': goto yy14;
00065 case '\r': goto yy12;
00066 case '"': goto yy8;
00067 case '&': goto yy6;
00068 case '\'': goto yy10;
00069 case '<': goto yy4;
00070 case '>': goto yy2;
00071 default: goto yy18;
00072 }
00073 yy2: yych = *++YYCURSOR;
00074 #line 57
00075 { rval += ">"; goto start; }
00076 yy4: yych = *++YYCURSOR;
00077 #line 58
00078 { rval += "<"; goto start; }
00079 yy6: yych = *++YYCURSOR;
00080 #line 59
00081 { rval += "&"; goto start; }
00082 yy8: yych = *++YYCURSOR;
00083 #line 60
00084 { rval += """; goto start; }
00085 yy10: yych = *++YYCURSOR;
00086 #line 61
00087 { rval += "'"; goto start; }
00088 yy12: yych = *++YYCURSOR;
00089 #line 62
00090 { rval += " "; goto start; }
00091 yy14: yych = *++YYCURSOR;
00092 #line 63
00093 { rval += " "; goto start; }
00094 yy16: yych = *++YYCURSOR;
00095 #line 64
00096 { rval += "	"; goto start; }
00097 yy18: yych = *++YYCURSOR;
00098 #line 65
00099 { rval += *(YYCURSOR-1); goto start; }
00100 yy20:
00101 #line 66
00102 { return rval.releaseString(); }
00103 }
00104 #line 67
00105 return rval.releaseString();
00106 }
00107
00108 }
00109