Back to index

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

#include <nsTextStringBundle.h>

Collaboration diagram for nsTextStringBundle:
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 nsIStringBundleGetStringBundleProxy (void)
static void FreeString (PRUnichar *pStr)
static void Cleanup (void)

Static Private Attributes

static nsIStringBundlem_pBundle = nsnull

Detailed Description

Definition at line 45 of file nsTextStringBundle.h.


Member Function Documentation

Definition at line 123 of file nsTextStringBundle.cpp.

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

Here is the caller graph for this function:

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

Definition at line 52 of file nsTextStringBundle.h.

{ nsCRT::free( pStr);}

Here is the caller graph for this function:

Definition at line 55 of file nsTextStringBundle.cpp.

{
       if (m_pBundle)
              return( m_pBundle);

       nsresult                    rv;
       static const char    propertyURL[] = TEXT_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 76 of file nsTextStringBundle.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 * nsTextStringBundle::GetStringByID ( PRInt32  stringID,
nsIStringBundle pBundle = nsnull 
) [static]

Definition at line 102 of file nsTextStringBundle.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 nsTextStringBundle::GetStringByID ( PRInt32  stringID,
nsString result,
nsIStringBundle pBundle = nsnull 
) [static]

Definition at line 94 of file nsTextStringBundle.cpp.

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

Here is the call graph for this function:


Member Data Documentation

Definition at line 56 of file nsTextStringBundle.h.


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