version 1.11.2.2, 2001/08/01 11:17:36
|
version 1.11.2.5, 2001/08/14 12:31:33
|
|
|
{ | { |
XmlWriter::appendSpecial(out, x); | XmlWriter::appendSpecial(out, x); |
} | } |
|
|
|
/** _toMof Internal function to convert the string back |
|
to MOF format and output it. |
|
The conversions are: |
|
\b // \x0008: backspace BS |
|
\t // \x0009: horizontal tab HT |
|
\n // \x000A: linefeed LF |
|
\f // \x000C: form feed FF |
|
\r // \x000D: carriage return CR |
|
\" // \x0022: double quote " |
|
\’ // \x0027: single quote ' |
|
\\ // \x005C: backslash \ |
|
\x<hex> // where <hex> is one to four hex digits |
|
\X<hex> // where <hex> is one to four hex digits |
|
*/ |
|
/* ATTN:KS - We need to account for characters greater than x'7f |
inline void _toMof(Array<Sint8>& out, const String& x) | inline void _toMof(Array<Sint8>& out, const String& x) |
{ | { |
out << "\""; | out << "\""; |
|
|
{ | { |
switch (c) | switch (c) |
{ | { |
case '"': |
case '\\': |
out.append("'", 1); |
out.append("\\\\",2); |
break; | break; |
| |
case ' ': |
case '\b': |
out.append(Sint8(c)); |
out.append("\\b",2); |
|
break; |
|
|
|
case '\t': |
|
out.append("\\t",2); |
|
break; |
|
|
|
case '\n': |
|
out.append("\\n",2); |
|
break; |
|
|
|
case '\f': |
|
out.append("\\f",2); |
|
break; |
|
|
|
case '\r': |
|
out.append("\\r",2); |
|
break; |
|
|
|
/* case '\'': |
|
out.append("\\'", 2); |
|
break;*/ |
|
|
|
case '"': |
|
out.append("\\\"", 2); |
break; | break; |
| |
default: | default: |
|
|
out << "</VALUE>\n"; | out << "</VALUE>\n"; |
} | } |
} | } |
|
/** _toMof Array - |
|
arrayInitializer = "{" constantValue*( "," constantValue)"}" |
|
|
|
*/ |
template<class T> | template<class T> |
void _toMof(Array<Sint8>& out, const T* p, Uint32 size) | void _toMof(Array<Sint8>& out, const T* p, Uint32 size) |
{ | { |
Boolean isFirstEntry = true; | Boolean isFirstEntry = true; |
|
// if there are any entries in the array output them |
|
if (size) |
|
{ |
out << "{"; | out << "{"; |
while (size--) | while (size--) |
{ | { |
|
|
_toMof(out, *p++); | _toMof(out, *p++); |
} | } |
out << "}"; | out << "}"; |
|
|
|
} |
} | } |
| |
template<class T> | template<class T> |