Back to index

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

#include <nsImportStringBundle.h>

Collaboration diagram for nsImportStringBundle:
Collaboration graph
[legend]

List of all members.

Static Public Member Functions

static PRUnicharGetStringByID (PRInt32 stringID, nsIStringBundle *pBundle=nsnull)
static void GetStringByID (PRInt32 stringID, nsString &result, nsIStringBundle *pBundle=nsnull)
static nsIStringBundleGetStringBundle (void)
static void FreeString (PRUnichar *pStr)
static void Cleanup (void)
static nsIStringBundleGetStringBundleProxy (void)

Static Private Attributes

static nsIStringBundlem_pBundle = nsnull

Detailed Description

Definition at line 45 of file nsImportStringBundle.h.


Member Function Documentation

Definition at line 120 of file nsImportStringBundle.cpp.

{
       if (m_pBundle)
              m_pBundle->Release();
       m_pBundle = nsnull;
}

Here is the caller graph for this function:

static void nsImportStringBundle::FreeString ( PRUnichar pStr) [inline, static]

Definition at line 50 of file nsImportStringBundle.h.

{ nsCRT::free( pStr);}

Here is the caller graph for this function:

Definition at line 53 of file nsImportStringBundle.cpp.

{
       if (m_pBundle)
              return( m_pBundle);

       nsresult                    rv;
       const char                  propertyURL[] = IMPORT_MSGS_URL;
       nsIStringBundle*     sBundle = nsnull;


       nsCOMPtr<nsIStringBundleService> sBundleService = 
                do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv); 
       if (NS_SUCCEEDED(rv) && (nsnull != sBundleService)) {
              rv = sBundleService->CreateBundle(propertyURL, &sBundle);
       }
       
       m_pBundle = sBundle;
       return( sBundle);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 73 of file nsImportStringBundle.cpp.

{
       if (!m_pBundle)
              return( nsnull);

       nsIStringBundle *strProxy = nsnull;
       nsresult rv;
       // create a proxy object if we aren't on the same thread?
       nsCOMPtr<nsIProxyObjectManager> proxyMgr = 
                do_GetService(kProxyObjectManagerCID, &rv);
       if (NS_SUCCEEDED(rv)) {
              rv = proxyMgr->GetProxyForObject( NS_UI_THREAD_EVENTQ, NS_GET_IID(nsIStringBundle),
                                                                      m_pBundle, PROXY_SYNC | PROXY_ALWAYS, (void **) &strProxy);
       }

       return( strProxy);
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRUnichar * nsImportStringBundle::GetStringByID ( PRInt32  stringID,
nsIStringBundle pBundle = nsnull 
) [static]

Definition at line 99 of file nsImportStringBundle.cpp.

{
       if (!pBundle) {
              pBundle = GetStringBundle();
       }
       
       if (pBundle) {
              PRUnichar *ptrv = nsnull;
              nsresult rv = pBundle->GetStringFromID(stringID, &ptrv);
                            
              if (NS_SUCCEEDED( rv) && ptrv)
                     return( ptrv);
       }

       nsString resultString(NS_LITERAL_STRING("[StringID "));
       resultString.AppendInt(stringID);
       resultString.AppendLiteral("?]");

       return( ToNewUnicode(resultString));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsImportStringBundle::GetStringByID ( PRInt32  stringID,
nsString result,
nsIStringBundle pBundle = nsnull 
) [static]

Definition at line 91 of file nsImportStringBundle.cpp.

{
       
       PRUnichar *ptrv = GetStringByID( stringID, pBundle);    
       result = ptrv;
       FreeString( ptrv);
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 55 of file nsImportStringBundle.h.


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