examples/ForumNokia/DescriptorExample/inc/StringRenderer.h

00001 /*
00002  * Copyright © 2008 Nokia Corporation.
00003  */
00004 
00005 #ifndef STRING_RENDERER_H
00006 #define STRING_RENDERER_H
00007 
00008 #include <e32std.h>
00009 
00010 // -----------------------------------------------------------------------------
00025 const TInt KRenderDefault = 0x00;
00026 const TInt KRenderContentAsBinary = 0x01;
00027 const TInt KRenderCharacteristics = 0x02;
00028 
00029 // -----------------------------------------------------------------------------
00041 void Append( const TDesC8 &aSrc, TDes16 &aDst );
00042 void Append( const TDesC16 &aSrc, TDes16 &aDst );
00043 
00044 // -----------------------------------------------------------------------------
00049 void RenderAsNumbers( const TDesC8 &anArray, TDes16 &aOutput );
00050 void RenderAsNumbers( const TDesC16 &anArray, TDes16 &aOutput );
00051 
00052 // -----------------------------------------------------------------------------
00058 void RenderObject(const TDesC8 &aVariable,
00059                   TDes16 &aOutput,
00060                   TInt aRenderFormat=KRenderDefault);
00061 void RenderObject(const TDes8 &aVariable,
00062                   TDes16 &aOutput,
00063                   TInt aRenderFormat=KRenderDefault);
00064 void RenderObject(const TDesC16 &aVariable,
00065                   TDes16 &aOutput,
00066                   TInt aRenderFormat=KRenderDefault );
00067 void RenderObject(const TDes16  &aVariable,
00068                   TDes16 &aOutput,
00069                   TInt aRenderFormat=KRenderDefault );
00070 void RenderObject(const TInt &aVariable,
00071                   TDes16 &aOutput,
00072                   TInt aRenderFormat=KRenderDefault );
00073 
00074 // -----------------------------------------------------------------------------
00083 void RenderHeader(const TDesC &aHeader, TDes &aOutput);
00084 
00085 // -----------------------------------------------------------------------------
00107 #define RenderVariableFormatted(aVariableName, aOutput, aRenderFormat) \
00108     aOutput.Append(_L(#aVariableName));\
00109     aOutput.Append('=');\
00110     RenderObject( aVariableName, aOutput, aRenderFormat );\
00111     aOutput.Append('\n');\
00112 
00113 // -----------------------------------------------------------------------------
00114 _LIT( KForward, " -> " );
00142 #define RenderResultFormatted(aDeclaration, aOutput, aRenderFormat) \
00143     aOutput.Append(_L(#aDeclaration));\
00144     aOutput.Append(KForward);\
00145     RenderObject( aDeclaration, aOutput, aRenderFormat );\
00146     aOutput.Append('\n');\
00147 
00148 // -----------------------------------------------------------------------------
00179 #define ExecuteAndRenderVariableFormatted(aDeclaration, \
00180                                           aVariable, \
00181                                           aOutput, \
00182                                           aRenderFormat) \
00183     aDeclaration;\
00184     aOutput.Append(_L(#aDeclaration));\
00185     aOutput.Append(KForward);\
00186     aOutput.Append(_L(#aVariable));\
00187     aOutput.Append('=');\
00188     RenderObject( aVariable, aOutput, aRenderFormat );\
00189     aOutput.Append('\n');\
00190 
00191 #endif // STRING_RENDERER_H

Generated by  doxygen 1.6.2