00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "CommonFramework.h"
00019
00020
00021
00022
00023 _LIT(KTxtNewLine,"\n");
00024
00025
00026
00027
00028 _LIT(KCommonFormat2,"Size()=%d; MaxLength()=%d\n");
00029 _LIT(KCommonFormat3,"0x%02x ");
00030 _LIT(KCommonFormat4,"; Length()=%d;\n");
00031
00032
00033 LOCAL_C void doExampleL()
00034 {
00035 TInt counter;
00036 TInt index;
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 TBuf8<32> buffer;
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 _LIT(KFormat1,"\"%S\"; Length()=%d; ");
00057 console->Printf(KFormat1,&buffer,buffer.Length());
00058 console->Printf(KCommonFormat2,buffer.Size(),buffer.MaxLength());
00059
00060
00061
00062 TUint8 data[6] = {0x00,0x01,0x02,0xAD,0xAE,0xAF};
00063
00064
00065 buffer.Append(&data[0],sizeof(data));
00066
00067
00068 buffer.Append(0xFD);
00069 buffer.Append(0xFE);
00070 buffer.Append(0xFF);
00071
00072
00073
00074 counter = buffer.Length();
00075 console->Printf(KTxtNewLine);
00076 for (index = 0; index < counter; index++)
00077 console->Printf(KCommonFormat3,buffer[index]);
00078
00079 console->Printf(KCommonFormat4,buffer.Length()
00080 );
00081 console->Printf(KCommonFormat2,buffer.Size(),buffer.MaxLength());
00082
00083
00084 buffer.Append('A');
00085 buffer.Append('B');
00086 buffer.Append(0x11);
00087
00088
00089 counter = buffer.Length();
00090 console->Printf(KTxtNewLine);
00091 for (index = 0; index < counter; index++)
00092 console->Printf(KCommonFormat3,buffer[index]);
00093
00094 console->Printf(KCommonFormat4,buffer.Length());
00095 console->Printf(KCommonFormat2,buffer.Size(),buffer.MaxLength());
00096 }