Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Member Functions | Private Attributes
nsExtensibleStringBundle Class Reference

An extesible implementation of the StringBudle interface. More...

#include <nsStringBundle.h>

Inheritance diagram for nsExtensibleStringBundle:
Inheritance graph
[legend]
Collaboration diagram for nsExtensibleStringBundle:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsExtensibleStringBundle ()
virtual ~nsExtensibleStringBundle ()
wstring GetStringFromID (in long aID)
wstring GetStringFromName (in wstring aName)
wstring formatStringFromID (in long aID,[array, size_is(length)] in wstring params, in unsigned long length)
wstring formatStringFromName (in wstring aName,[array, size_is(length)] in wstring params, in unsigned long length)
nsISimpleEnumerator getSimpleEnumeration ()

Private Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSISTRINGBUNDLE
nsresult 
Init (const char *aCategory, nsIStringBundleService *)

Private Attributes

nsCOMArray< nsIStringBundlemBundles
PRBool mLoaded

Detailed Description

An extesible implementation of the StringBudle interface.

28/Dec/1999

Author:
Catalin Rotaru [CATA]

Definition at line 88 of file nsStringBundle.h.


Constructor & Destructor Documentation

Definition at line 408 of file nsStringBundle.cpp.

Definition at line 454 of file nsStringBundle.cpp.

{
}

Member Function Documentation

wstring nsIStringBundle::formatStringFromID ( in long  aID,
[array, size_is(length)] in wstring  params,
in unsigned long  length 
) [inherited]
wstring nsIStringBundle::formatStringFromName ( in wstring  aName,
[array, size_is(length)] in wstring  params,
in unsigned long  length 
) [inherited]
wstring nsIStringBundle::GetStringFromID ( in long  aID) [inherited]

Here is the caller graph for this function:

wstring nsIStringBundle::GetStringFromName ( in wstring  aName) [inherited]

Here is the caller graph for this function:

nsresult nsExtensibleStringBundle::Init ( const char *  aCategory,
nsIStringBundleService aBundleService 
) [private]

Definition at line 414 of file nsStringBundle.cpp.

{

  nsresult rv;
  nsCOMPtr<nsICategoryManager> catman =
    do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
  if (NS_FAILED(rv)) return rv;

  nsCOMPtr<nsISimpleEnumerator> enumerator;
  rv = catman->EnumerateCategory(aCategory, getter_AddRefs(enumerator));
  if (NS_FAILED(rv)) return rv;

  PRBool hasMore;
  while (NS_SUCCEEDED(enumerator->HasMoreElements(&hasMore)) && hasMore) {
    nsCOMPtr<nsISupports> supports;
    rv = enumerator->GetNext(getter_AddRefs(supports));
    if (NS_FAILED(rv))
      continue;

    nsCOMPtr<nsISupportsCString> supStr = do_QueryInterface(supports, &rv);
    if (NS_FAILED(rv))
      continue;

    nsCAutoString name;
    rv = supStr->GetData(name);
    if (NS_FAILED(rv))
      continue;

    nsCOMPtr<nsIStringBundle> bundle;
    rv = aBundleService->CreateBundle(name.get(), getter_AddRefs(bundle));
    if (NS_FAILED(rv))
      continue;

    mBundles.AppendObject(bundle);
  }

  return rv;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 96 of file nsStringBundle.h.

Definition at line 97 of file nsStringBundle.h.


The documentation for this class was generated from the following files: