Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions
nsStreamConverterService.cpp File Reference
#include "nsStreamConverterService.h"
#include "nsIServiceManager.h"
#include "nsIComponentManager.h"
#include "nsString.h"
#include "nsReadableUtils.h"
#include "nsIAtom.h"
#include "nsDeque.h"
#include "nsIInputStream.h"
#include "nsIOutputStream.h"
#include "nsIStreamConverter.h"
#include "nsICategoryManager.h"
#include "nsXPCOM.h"
#include "nsISupportsPrimitives.h"
#include "nsXPIDLString.h"

Go to the source code of this file.

Classes

class  CStreamConvDeallocator

Functions

static PRBool PR_CALLBACK DeleteAdjacencyEntry (nsHashKey *aKey, void *aData, void *closure)
static PRBool PR_CALLBACK InitBFSTable (nsHashKey *aKey, void *aData, void *closure)
static PRBool PR_CALLBACK DeleteBFSEntry (nsHashKey *aKey, void *aData, void *closure)
nsresult NS_NewStreamConv (nsStreamConverterService **aStreamConv)

Function Documentation

static PRBool PR_CALLBACK DeleteAdjacencyEntry ( nsHashKey *  aKey,
void aData,
void closure 
) [static]

Definition at line 87 of file nsStreamConverterService.cpp.

                                                                                            {
    SCTableData *entry = (SCTableData*)aData;
    NS_ASSERTION(entry->key && entry->data.edges, "malformed adjacency list entry");
    delete entry->key;
    delete entry->data.edges;
    delete entry;
    return PR_TRUE;   
}

Here is the caller graph for this function:

static PRBool PR_CALLBACK DeleteBFSEntry ( nsHashKey *  aKey,
void aData,
void closure 
) [static]

Definition at line 286 of file nsStreamConverterService.cpp.

                                                                                      {
    SCTableData *data = (SCTableData*)aData;
    BFSState *state = data->data.state;
    delete state;
    data->key = nsnull;
    delete data;
    return PR_TRUE;
}

Here is the caller graph for this function:

static PRBool PR_CALLBACK InitBFSTable ( nsHashKey *  aKey,
void aData,
void closure 
) [static]

Definition at line 261 of file nsStreamConverterService.cpp.

                                                                                    {
    NS_ASSERTION((SCTableData*)aData, "no data in the table enumeration");
    
    nsHashtable *BFSTable = (nsHashtable*)closure;
    if (!BFSTable) return PR_FALSE;

    BFSState *state = new BFSState;
    if (!state) return PR_FALSE;

    state->color = white;
    state->distance = -1;
    state->predecessor = nsnull;

    SCTableData *data = new SCTableData(NS_STATIC_CAST(nsCStringKey*, aKey));
    if (!data) {
        delete state;
        return PR_FALSE;
    }
    data->data.state = state;

    BFSTable->Put(aKey, data);
    return PR_TRUE;   
}

Here is the caller graph for this function:

Definition at line 662 of file nsStreamConverterService.cpp.

{
    NS_PRECONDITION(aStreamConv != nsnull, "null ptr");
    if (!aStreamConv) return NS_ERROR_NULL_POINTER;

    *aStreamConv = new nsStreamConverterService();
    if (!*aStreamConv) return NS_ERROR_OUT_OF_MEMORY;

    NS_ADDREF(*aStreamConv);
    nsresult rv = (*aStreamConv)->Init();
    if (NS_FAILED(rv))
        NS_RELEASE(*aStreamConv);

    return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function: