diff -r 51a74ef9ed63 -r ae94777fff8f Symbian3/SDK/Source/GUID-9620407B-0560-5D95-A862-5AE406C48983.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-9620407B-0560-5D95-A862-5AE406C48983.dita Fri Jun 11 12:39:03 2010 +0100 @@ -0,0 +1,61 @@ + + + + + +String +resource reader overview +
Purpose

String +Resource Reader is part of the Symbian Text Utilities component. It reads +strings from resource files without using the CCoeEnv instance. +This module is mainly for server usage, where there is a need for reading +resources, but there is no CCoeEnv instance +present.

+
Architectural +Relationships

The key relationships between String Resource Reader +and the components in its environment are shown below. It uses the RResourceFile class to access +the actual resource files.

+ String Resource Reader environment + +

String Resource Reader consists of one class, CTulStringResourceReader. +String Resource Reader uses BaflUtils and RResourceFile.

+ Class diagram + +
+
Description

Usage

String +Resource Reader is designed to load strings from normal resource files. The +interface can be accessed through the tulstringresourcereader.h file

    +
  • 1. The user must first +create an instance of the CTulStringResourceReader class +using one of the factory methods NewL() or NewLC().

  • +
  • 2. The user can then +call the exported ReadResourceString() method +to read resources

  • +
  • 3. After usage the created +instance must be deleted.

  • +

If the resource file that is given to a constructor is not found, +the constructor leaves. The standard Symbian platform error codes are used.

Example

An +example of using the interface is given below:

#include <tulstringresourcereader.h> +#include <errorres.rsg> // Resource to be read header + +//... +TFileName myFileName( _L("z:\\system\\data\\errorres.rsc") ); +TulTextResourceUtils* test = TulTextResourceUtils::NewL( myFileName ); + +TPtrC buf; +buf.Set(test-> ReadResourceString(R_ERROR_RES_GENERAL)); + +// Note that buf will only be valid as long as TulTextResourceUtils +// instance is alive and no new string is read by the same instance. +// If you need to read multiple strings, make copies. + +delete test; +

For more information on individual methods, see the reference +API for CTulStringResourceReader.

+
\ No newline at end of file