Back to index

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

#include <nsImportService.h>

Collaboration diagram for nsImportModuleList:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsImportModuleList ()
 ~nsImportModuleList ()
void AddModule (const nsCID &cid, const char *pSupports, const PRUnichar *pName, const PRUnichar *pDesc)
void ClearList (void)
PRInt32 GetCount (void)
ImportModuleDescGetModuleDesc (PRInt32 idx)

Private Attributes

ImportModuleDesc ** m_pList
PRInt32 m_alloc
PRInt32 m_count

Detailed Description

Definition at line 107 of file nsImportService.h.


Constructor & Destructor Documentation

Definition at line 109 of file nsImportService.h.

{ m_pList = nsnull; m_alloc = 0; m_count = 0;}

Definition at line 110 of file nsImportService.h.

{ ClearList(); }

Here is the call graph for this function:


Member Function Documentation

void nsImportModuleList::AddModule ( const nsCID cid,
const char *  pSupports,
const PRUnichar pName,
const PRUnichar pDesc 
)

Definition at line 647 of file nsImportService.cpp.

{
       if (m_pList == nsnull) {
              m_alloc = 10;
              m_pList = new ImportModuleDesc *[m_alloc];
              m_count = 0;
              memset( m_pList, 0, sizeof( ImportModuleDesc *) * m_alloc);
       }
       
       if (m_count == m_alloc) {
              ImportModuleDesc **pList = new ImportModuleDesc *[m_alloc + 10];
              memset( &(pList[m_alloc]), 0, sizeof( ImportModuleDesc *) * 10);
              memcpy( pList, m_pList, sizeof( ImportModuleDesc *) * m_alloc);
    for(int i = 0; i < m_count; i++)
      delete m_pList[i];
    delete [] m_pList;
              m_pList = pList;
              m_alloc += 10;
       }
       
       m_pList[m_count] = new ImportModuleDesc();
       m_pList[m_count]->SetCID( cid);
       m_pList[m_count]->SetSupports( pSupports);
       m_pList[m_count]->SetName( pName);
       m_pList[m_count]->SetDescription( pDesc);
       
       m_count++;
#ifdef IMPORT_DEBUG
       nsCString     name; name.AssignWithConversion( pName);
       nsCString     desc; desc.AssignWithConversion( pDesc);
       IMPORT_LOG3( "* nsImportService registered import module: %s, %s, %s\n", name.get(), desc.get(), pSupports);
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 631 of file nsImportService.cpp.

{
       if (m_pList != nsnull) {
              for (int i = 0; i < m_count; i++) {
                     if (m_pList[i] != nsnull)
                            delete m_pList[i];   
                     m_pList[i] = nsnull;
              }
              m_count = 0;
              delete [] m_pList;
              m_pList = nsnull;
              m_alloc = 0;
       }
       
}

Here is the caller graph for this function:

Definition at line 116 of file nsImportService.h.

{ return( m_count);}

Definition at line 118 of file nsImportService.h.

              { if ((idx < 0) || (idx >= m_count)) return( nsnull); else return( m_pList[idx]);}

Member Data Documentation

Definition at line 125 of file nsImportService.h.

Definition at line 126 of file nsImportService.h.

Definition at line 124 of file nsImportService.h.


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