00001 
00002 
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 #ifndef STRING_RENDERER_H
00032 #define STRING_RENDERER_H
00033 
00034 #include <e32std.h>
00035 
00036 
00051 const TInt KRenderDefault = 0x00;
00052 const TInt KRenderContentAsBinary = 0x01;
00053 const TInt KRenderCharacteristics = 0x02;
00054 
00055 
00067 void Append( const TDesC8 &aSrc, TDes16 &aDst );
00068 void Append( const TDesC16 &aSrc, TDes16 &aDst );
00069 
00070 
00075 void RenderAsNumbers( const TDesC8 &anArray, TDes16 &aOutput );
00076 void RenderAsNumbers( const TDesC16 &anArray, TDes16 &aOutput );
00077 
00078 
00084 void RenderObject(const TDesC8 &aVariable,
00085                   TDes16 &aOutput,
00086                   TInt aRenderFormat=KRenderDefault);
00087 void RenderObject(const TDes8 &aVariable,
00088                   TDes16 &aOutput,
00089                   TInt aRenderFormat=KRenderDefault);
00090 void RenderObject(const TDesC16 &aVariable,
00091                   TDes16 &aOutput,
00092                   TInt aRenderFormat=KRenderDefault );
00093 void RenderObject(const TDes16  &aVariable,
00094                   TDes16 &aOutput,
00095                   TInt aRenderFormat=KRenderDefault );
00096 void RenderObject(const TInt &aVariable,
00097                   TDes16 &aOutput,
00098                   TInt aRenderFormat=KRenderDefault );
00099 
00100 
00109 void RenderHeader(const TDesC &aHeader, TDes &aOutput);
00110 
00111 
00133 #define RenderVariableFormatted(aVariableName, aOutput, aRenderFormat) \
00134     aOutput.Append(_L(#aVariableName));\
00135     aOutput.Append('=');\
00136     RenderObject( aVariableName, aOutput, aRenderFormat );\
00137     aOutput.Append('\n');\
00138 
00139 
00140 _LIT( KForward, " -> " );
00168 #define RenderResultFormatted(aDeclaration, aOutput, aRenderFormat) \
00169     aOutput.Append(_L(#aDeclaration));\
00170     aOutput.Append(KForward);\
00171     RenderObject( aDeclaration, aOutput, aRenderFormat );\
00172     aOutput.Append('\n');\
00173 
00174 
00205 #define ExecuteAndRenderVariableFormatted(aDeclaration, \
00206                                           aVariable, \
00207                                           aOutput, \
00208                                           aRenderFormat) \
00209     aDeclaration;\
00210     aOutput.Append(_L(#aDeclaration));\
00211     aOutput.Append(KForward);\
00212     aOutput.Append(_L(#aVariable));\
00213     aOutput.Append('=');\
00214     RenderObject( aVariable, aOutput, aRenderFormat );\
00215     aOutput.Append('\n');\
00216 
00217 #endif // STRING_RENDERER_H