diff -r 43e37759235e -r 51a74ef9ed63 Symbian3/SDK/Source/GUID-24D509E8-CF46-58D3-85E9-27DA7AB22012.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-24D509E8-CF46-58D3-85E9-27DA7AB22012.dita Wed Mar 31 11:11:55 2010 +0100 @@ -0,0 +1,85 @@ + + + + + +Constructing +a Static String TableA static string table can be built in any .mmp file; +the most common use is as part of building an application. + + +Add the following lines to the .mmp file: +START STRINGTABLE ExampleStringTable.st +EXPORTPATH /epoc32/include +END +This code:
    +
  1. generates the .cpp file +and the .h file

  2. +
  3. copies the generated .h file +to epoc/include

  4. +
  5. handles the generated .cpp file +as part of the source of the overall executable.

  6. +
+
+ +Include the following in the bld.inf file: +PRJ_MMPFILES +.\StringTableExample.mmp + +
+Static string table example

The following is an +example .mmp file, StringTableExample.mmp:

// StringTableExample.MMP + + +TARGET StringTableExample.exe +TARGETTYPE exe + +SYSTEMINCLUDE \epoc32\include + +SOURCEPATH . +SOURCE StringTableExample.cpp + +START STRINGTABLE ExampleStringTable.st +EXPORTPATH /epoc32/include +END + +LIBRARY EUSER.LIB BAFL.LIB +VENDORID 0x70000001

Note: The previous example .mmp file +builds the following .cpp file that uses the string pool:

// StringTableExample.cpp + +#include "e32base.h" +#include "e32svr.h" +#include "StringPool.h" +#include "ExampleStringTable.h" + +void StartL() + { + TBuf<100> buf; + RStringPool pool; + pool.OpenL( ExampleStringTable::Table ); + buf.Copy( pool.StringF( ExampleStringTable::EApple,ExampleStringTable::Table ).DesC() ); + RDebug::Print( buf ); + } + +// main loop +// +GLDEF_C TInt E32Main() + { + // Install exception handler + CTrapCleanup* theCleanup = CTrapCleanup::New(); + TRAPD( err,StartL() ); + delete theCleanup; + return( KErrNone ); + }
+
+String Pools + +Using string +pool +
\ No newline at end of file