Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

StringBundle Class Reference

Class to operate on string bundles. More...

List of all members.

Public Member Functions


Detailed Description

Class to operate on string bundles.

Extended format string:
This class can use non-standard format strings, with higher flexibility than mozilla standard one.
Those strings use those rules:


Constructor & Destructor Documentation

void StringBundle Object  uri  ) 
 

Create new StringBundle object.

Parameters:
uri Bundle url. Can be passed as String or as nsIURL object.
Exceptions:
StringBundleError Thrown on XPCOM error.


Member Function Documentation

String formatString String  name,
Array  args
 

Get string from bundle, and format it.

This method use default mozilla syntax format strings..

Parameters:
name Id of string in bundle with format specification.
args Array with arguments to formater. If this is not Array, this value and all following one will be passed to formater.
Returns:
Formated string.
Exceptions:
StringBundleError Thrown when any error.

String formatStringEx String  name,
Array  args
 

Format string from bundle, which use extended syntax.

This syntax is described in extended format string definition.

Examples:
   number = {0}{0 : 1 -> 'st', 2 -> 'nd', 4 -> 'rd', 'th'} (in bundle)
   formatStringEx("number", [2]) = "2nd"
 
   removeQuestion = \{Usunac {0: 1 -> 'plik', 'pliki'}?\} (in bundle)
   formatStringEx("removeQuestion", [1]] = "{Usunac plik?}"
Parameters:
name Id of string in bundle with format specification.
args Array with arguments to formater. If this is not Array, this value and all following one will be passed to formater.
Returns:
Formated string.
Exceptions:
StringBundleError Thrown when any error.

String getString String  name  ) 
 

Get string from bundle.

Parameters:
name Name of string to get.
Returns:
String from bundle, identified with key name.
Exceptions:
StringBundleError Thrown on any error.


The documentation for this class was generated from the following file:
Generated on Tue Jan 4 01:03:51 2005 for JabberZilla by  doxygen 1.4.0