Back to index

lightning-sunbird  0.9+nobinonly
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Friends
NS_COM_GLUE Protocol Reference

#include <nsComponentManagerUtils.h>

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

List of all members.

Classes

struct  GSClosureStruct
struct  Header
struct  INIValue

Public Types

enum  { NoIndex = index_type(-1) }
typedef PRBool(* PR_CALLBACK )(const char *aSection, void *aClosure)
 Callback for GetSections.
typedef PRBool(* PR_CALLBACK )(const char *aString, const char *aValue, void *aClosure)
 Callback for GetStrings.
typedef PRUint32 size_type
typedef PRUint32 index_type

Public Member Functions

 nsCreateInstanceByCID (const nsCID &aCID, nsISupports *aOuter, nsresult *aErrorPtr)
virtual nsresult NS_FASTCALL operator() (const nsIID &, void **) const
 nsCreateInstanceByContractID (const char *aContractID, nsISupports *aOuter, nsresult *aErrorPtr)
virtual nsresult NS_FASTCALL operator() (const nsIID &, void **) const
 nsCreateInstanceFromFactory (nsIFactory *aFactory, nsISupports *aOuter, nsresult *aErrorPtr)
virtual nsresult NS_FASTCALL operator() (const nsIID &, void **) const
 nsGetClassObjectByCID (const nsCID &aCID, nsresult *aErrorPtr)
virtual nsresult NS_FASTCALL operator() (const nsIID &, void **) const
 nsGetClassObjectByContractID (const char *aContractID, nsresult *aErrorPtr)
virtual nsresult NS_FASTCALL operator() (const nsIID &, void **) const
 nsQueryInterface (nsISupports *aRawPtr)
nsresult NS_FASTCALL operator() (const nsIID &aIID, void **) const
 nsQueryInterfaceWithError (nsISupports *aRawPtr, nsresult *error)
nsresult NS_FASTCALL operator() (const nsIID &aIID, void **) const
 nsGetServiceByCID (const nsCID &aCID)
nsresult NS_FASTCALL operator() (const nsIID &, void **) const
 nsGetServiceByCIDWithError (const nsCID &aCID, nsresult *aErrorPtr)
nsresult NS_FASTCALL operator() (const nsIID &, void **) const
 nsGetServiceByContractID (const char *aContractID)
nsresult NS_FASTCALL operator() (const nsIID &, void **) const
 nsGetServiceByContractIDWithError (const char *aContractID, nsresult *aErrorPtr)
nsresult NS_FASTCALL operator() (const nsIID &, void **) const
 nsGetInterface (nsISupports *aSource, nsresult *error)
virtual nsresult NS_FASTCALL operator() (const nsIID &, void **) const
 nsINIParser ()
 ~nsINIParser ()
nsresult Init (nsILocalFile *aFile)
 Initialize the INIParser with a nsILocalFile.
nsresult Init (const char *aPath)
 Initialize the INIParser with a file path.
nsresult GetSections (INISectionCallback aCB, void *aClosure)
 Enumerate the sections within the INI file.
nsresult GetStrings (const char *aSection, INIStringCallback aCB, void *aClosure)
 Enumerate the strings within a section.
nsresult GetString (const char *aSection, const char *aKey, nsACString &aResult)
 Get the value of the specified key in the specified section of the INI file represented by this instance.
nsresult GetString (const char *aSection, const char *aKey, char *aResult, PRUint32 aResultLen)
 Alternate signature of GetString that uses a pre-allocated buffer instead of a nsACString (for use in the standalone glue before the glue is initialized).
 nsQueryReferent (nsIWeakReference *aWeakPtr, nsresult *error)
virtual nsresult NS_FASTCALL operator() (const nsIID &aIID, void **) const
size_type Length () const
PRBool IsEmpty () const
size_type Capacity () const
 nsSupportsWeakReference ()
void QueryReferent (in nsIIDRef uuid,[iid_is(uuid), retval] out nsQIResult result)
 |QueryReferent| queries the referent, if it exists, and like |QueryInterface|, produces an owning reference to the desired interface.
nsIWeakReference GetWeakReference ()
 |GetWeakReference| produces an appropriate instance of |nsIWeakReference|.

Protected Member Functions

 nsTArray_base ()
PRBool EnsureCapacity (size_type capacity, size_type elementSize)
void ShrinkCapacity (size_type elementSize)
void ShiftData (index_type start, size_type oldLen, size_type newLen, size_type elementSize)
void IncrementLength (PRUint32 n)
 ~nsSupportsWeakReference ()
void ClearWeakReferences ()
PRBool HasWeakReferences () const

Protected Attributes

HeadermHdr

Static Protected Attributes

static const Header sEmptyHdr

Private Member Functions

nsresult InitFromFILE (FILE *fd)
void NoticeProxyDestruction ()
 nsWeakReference (nsSupportsWeakReference *referent)
 ~nsWeakReference ()
void NoticeReferentDestruction ()

Static Private Member Functions

static PLDHashOperator GetSectionsCB (const char *aKey, INIValue *aData, void *aClosure)

Private Attributes

const nsCIDmCID
nsISupports * mOuter
nsresultmErrorPtr
const char * mContractID
nsIFactorymFactory
nsISupports * mRawPtr
nsISupports * mSource
nsClassHashtable
< nsDepCharHashKey, INIValue
mSections
nsAutoArrayPtr< char > mFileContents
nsIWeakReferencemWeakPtr
nsWeakReferencemProxy
nsSupportsWeakReferencemReferent

Friends

class nsWeakReference
class nsSupportsWeakReference

Detailed Description

Definition at line 71 of file nsComponentManagerUtils.h.


Class Documentation

struct NS_COM_GLUE::GSClosureStruct

Definition at line 143 of file nsINIParser.h.

Class Members
INISectionCallback usercb
void * userclosure
struct NS_COM_GLUE::Header

Definition at line 115 of file nsTArray.h.

Class Members
PRUint32 mCapacity
PRUint32 mLength

Member Typedef Documentation

Definition at line 55 of file nsTArray.h.

typedef PRBool(* NS_COM_GLUE::PR_CALLBACK)(const char *aSection, void *aClosure)

Callback for GetSections.

Returns:
PR_FALSE to stop enumeration, or PR_TRUE to continue.

Definition at line 81 of file nsINIParser.h.

typedef PRBool(* NS_COM_GLUE::PR_CALLBACK)(const char *aString, const char *aValue, void *aClosure)

Callback for GetStrings.

Returns:
PR_FALSE to stop enumeration, or PR_TRUE to continue

Definition at line 94 of file nsINIParser.h.

Definition at line 54 of file nsTArray.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
NoIndex 

Definition at line 59 of file nsTArray.h.

         {
      NoIndex = index_type(-1)
    };

Constructor & Destructor Documentation

Definition at line 58 of file nsINIParser.h.

{ }
NS_COM_GLUE::~nsSupportsWeakReference ( ) [inline, protected]
NS_COM_GLUE::~nsWeakReference ( ) [inline, private]

Definition at line 107 of file nsWeakReference.h.

        {
          if ( mReferent )
            mReferent->NoticeProxyDestruction();
        }

Member Function Documentation

size_type NS_COM_GLUE::Capacity ( ) const [inline]

Definition at line 76 of file nsTArray.h.

                               {
      return mHdr->mCapacity;
    }
void NS_COM_GLUE::ClearWeakReferences ( ) [inline, protected]
PRBool NS_COM_GLUE::EnsureCapacity ( size_type  capacity,
size_type  elementSize 
) [protected]
nsresult NS_COM_GLUE::GetSections ( INISectionCallback  aCB,
void aClosure 
)

Enumerate the sections within the INI file.

static PLDHashOperator NS_COM_GLUE::GetSectionsCB ( const char *  aKey,
INIValue aData,
void aClosure 
) [static, private]
nsresult NS_COM_GLUE::GetString ( const char *  aSection,
const char *  aKey,
nsACString &  aResult 
)

Get the value of the specified key in the specified section of the INI file represented by this instance.

Parameters:
aSectionsection name
aKeykey name
aResultthe value found
Exceptions:
NS_ERROR_FAILUREif the specified section/key could not be found.
nsresult NS_COM_GLUE::GetString ( const char *  aSection,
const char *  aKey,
char *  aResult,
PRUint32  aResultLen 
)

Alternate signature of GetString that uses a pre-allocated buffer instead of a nsACString (for use in the standalone glue before the glue is initialized).

Exceptions:
NS_ERROR_LOSS_OF_SIGNIFICANT_DATAif the aResult buffer is not large enough for the data. aResult will be filled with as much data as possible.
See also:
GetString [1]
nsresult NS_COM_GLUE::GetStrings ( const char *  aSection,
INIStringCallback  aCB,
void aClosure 
)

Enumerate the strings within a section.

If the section does not exist, this function will silently return.

|GetWeakReference| produces an appropriate instance of |nsIWeakReference|.

As with all good XPCOM `getters', you own the resulting interface and should manage it with an |nsCOMPtr|.

See also:
nsIWeakReference
nsWeakPtr
nsCOMPtr
PRBool NS_COM_GLUE::HasWeakReferences ( ) const [inline, protected]

Definition at line 82 of file nsWeakReference.h.

{return mProxy != 0;}
void NS_COM_GLUE::IncrementLength ( PRUint32  n) [inline, protected]

Definition at line 106 of file nsTArray.h.

                                     {
      NS_ASSERTION(mHdr != &sEmptyHdr, "bad data pointer");
      mHdr->mLength += n;
    }

Initialize the INIParser with a nsILocalFile.

If this method fails, no other methods should be called. This method reads and parses the file, the class does not hold a file handle open. An instance must only be initialized once.

nsresult NS_COM_GLUE::Init ( const char *  aPath)

Initialize the INIParser with a file path.

If this method fails, no other methods should be called. This method reads and parses the file, the class does not hold a file handle open. An instance must only be initialized once.

PRBool NS_COM_GLUE::IsEmpty ( void  ) const [inline]

Definition at line 69 of file nsTArray.h.

                           {
      return Length() == 0;
    }

Here is the call graph for this function:

size_type NS_COM_GLUE::Length ( ) const [inline]

Definition at line 64 of file nsTArray.h.

                             {
      return mHdr->mLength;
    }

Here is the caller graph for this function:

Definition at line 71 of file nsWeakReference.h.

        {
          mProxy = 0;
        }

Definition at line 115 of file nsWeakReference.h.

        {
          mReferent = 0;
        }
NS_COM_GLUE::nsCreateInstanceByCID ( const nsCID aCID,
nsISupports *  aOuter,
nsresult aErrorPtr 
) [inline]

Definition at line 74 of file nsComponentManagerUtils.h.

        : mCID(aCID),
          mOuter(aOuter),
          mErrorPtr(aErrorPtr)
    {
        // nothing else to do here
    }
NS_COM_GLUE::nsCreateInstanceByContractID ( const char *  aContractID,
nsISupports *  aOuter,
nsresult aErrorPtr 
) [inline]

Definition at line 93 of file nsComponentManagerUtils.h.

        : mContractID(aContractID),
          mOuter(aOuter),
          mErrorPtr(aErrorPtr)
    {
        // nothing else to do here
    }
NS_COM_GLUE::nsCreateInstanceFromFactory ( nsIFactory aFactory,
nsISupports *  aOuter,
nsresult aErrorPtr 
) [inline]

Definition at line 112 of file nsComponentManagerUtils.h.

        : mFactory(aFactory),
          mOuter(aOuter),
          mErrorPtr(aErrorPtr)
    {
        // nothing else to do here
    }
NS_COM_GLUE::nsGetClassObjectByCID ( const nsCID aCID,
nsresult aErrorPtr 
) [inline]

Definition at line 175 of file nsComponentManagerUtils.h.

        : mCID(aCID),
          mErrorPtr(aErrorPtr)
    {
        // nothing else to do here
    }
NS_COM_GLUE::nsGetClassObjectByContractID ( const char *  aContractID,
nsresult aErrorPtr 
) [inline]

Definition at line 192 of file nsComponentManagerUtils.h.

        : mContractID(aContractID),
          mErrorPtr(aErrorPtr)
    {
        // nothing else to do here
    }
NS_COM_GLUE::nsGetInterface ( nsISupports *  aSource,
nsresult error 
) [inline]

Definition at line 61 of file nsIInterfaceRequestorUtils.h.

          : mSource(aSource),
            mErrorPtr(error)
        {
          // nothing else to do here
        }

Definition at line 417 of file nsCOMPtr.h.

        : mCID(aCID)
        {
            // nothing else to do
        }
NS_COM_GLUE::nsGetServiceByCIDWithError ( const nsCID aCID,
nsresult aErrorPtr 
) [inline]

Definition at line 432 of file nsCOMPtr.h.

        : mCID(aCID),
          mErrorPtr(aErrorPtr)
        {
            // nothing else to do
        }
NS_COM_GLUE::nsGetServiceByContractID ( const char *  aContractID) [inline]

Definition at line 449 of file nsCOMPtr.h.

        : mContractID(aContractID)
        {
            // nothing else to do
        }
NS_COM_GLUE::nsGetServiceByContractIDWithError ( const char *  aContractID,
nsresult aErrorPtr 
) [inline]

Definition at line 464 of file nsCOMPtr.h.

        : mContractID(aContractID),
          mErrorPtr(aErrorPtr)
        {
            // nothing else to do
        }

Definition at line 57 of file nsINIParser.h.

{ }
NS_COM_GLUE::nsQueryInterface ( nsISupports *  aRawPtr) [inline, explicit]

Definition at line 348 of file nsCOMPtr.h.

          : mRawPtr(aRawPtr)
        {
          // nothing else to do here
        }
NS_COM_GLUE::nsQueryInterfaceWithError ( nsISupports *  aRawPtr,
nsresult error 
) [inline]

Definition at line 363 of file nsCOMPtr.h.

          : mRawPtr(aRawPtr),
            mErrorPtr(error)
        {
          // nothing else to do here
        }
NS_COM_GLUE::nsQueryReferent ( nsIWeakReference aWeakPtr,
nsresult error 
) [inline]

Definition at line 70 of file nsIWeakReferenceUtils.h.

          : mWeakPtr(aWeakPtr),
            mErrorPtr(error)
        {
          // nothing else to do here
        }

Definition at line 56 of file nsWeakReference.h.

          : mProxy(0)
        {
          // nothing else to do here
        }
NS_COM_GLUE::nsTArray_base ( ) [inline, protected]

Definition at line 81 of file nsTArray.h.

NS_COM_GLUE::nsWeakReference ( nsSupportsWeakReference referent) [inline, private]

Definition at line 100 of file nsWeakReference.h.

          : mReferent(referent)
          // ...I can only be constructed by an |nsSupportsWeakReference|
        {
          // nothing else to do here
        }
virtual nsresult NS_FASTCALL NS_COM_GLUE::operator() ( const nsIID ,
void **   
) const [virtual]

Implements nsCOMPtr_helper.

virtual nsresult NS_FASTCALL NS_COM_GLUE::operator() ( const nsIID aIID,
void **   
) const [virtual]

Implements nsCOMPtr_helper.

virtual nsresult NS_FASTCALL NS_COM_GLUE::operator() ( const nsIID ,
void **   
) const [virtual]

Implements nsCOMPtr_helper.

virtual nsresult NS_FASTCALL NS_COM_GLUE::operator() ( const nsIID ,
void **   
) const [virtual]

Implements nsCOMPtr_helper.

virtual nsresult NS_FASTCALL NS_COM_GLUE::operator() ( const nsIID ,
void **   
) const [virtual]

Implements nsCOMPtr_helper.

virtual nsresult NS_FASTCALL NS_COM_GLUE::operator() ( const nsIID ,
void **   
) const [virtual]

Implements nsCOMPtr_helper.

virtual nsresult NS_FASTCALL NS_COM_GLUE::operator() ( const nsIID ,
void **   
) const [virtual]

Implements nsCOMPtr_helper.

nsresult NS_FASTCALL NS_COM_GLUE::operator() ( const nsIID aIID,
void **   
) const [virtual]

Implements nsCOMPtr_helper.

nsresult NS_FASTCALL NS_COM_GLUE::operator() ( const nsIID aIID,
void **   
) const [virtual]

Implements nsCOMPtr_helper.

nsresult NS_FASTCALL NS_COM_GLUE::operator() ( const nsIID ,
void **   
) const [virtual]

Implements nsCOMPtr_helper.

nsresult NS_FASTCALL NS_COM_GLUE::operator() ( const nsIID ,
void **   
) const [virtual]

Implements nsCOMPtr_helper.

nsresult NS_FASTCALL NS_COM_GLUE::operator() ( const nsIID ,
void **   
) const [virtual]

Implements nsCOMPtr_helper.

nsresult NS_FASTCALL NS_COM_GLUE::operator() ( const nsIID ,
void **   
) const [virtual]

Implements nsCOMPtr_helper.

void nsIWeakReference::QueryReferent ( in nsIIDRef  uuid,
[iid_is(uuid), retval] out nsQIResult  result 
) [inherited]

|QueryReferent| queries the referent, if it exists, and like |QueryInterface|, produces an owning reference to the desired interface.

It is designed to look and act exactly like (a proxied) |QueryInterface|. Don't hold on to the produced interface permanently; that would defeat the purpose of using a non-owning |nsIWeakReference| in the first place.

Here is the caller graph for this function:

void NS_COM_GLUE::ShiftData ( index_type  start,
size_type  oldLen,
size_type  newLen,
size_type  elementSize 
) [protected]
void NS_COM_GLUE::ShrinkCapacity ( size_type  elementSize) [protected]

Friends And Related Function Documentation

friend class nsSupportsWeakReference [friend]

Definition at line 98 of file nsWeakReference.h.

friend class nsWeakReference [friend]

Definition at line 68 of file nsWeakReference.h.


Member Data Documentation

Definition at line 85 of file nsComponentManagerUtils.h.

const char * NS_COM_GLUE::mContractID [private]

Definition at line 104 of file nsComponentManagerUtils.h.

Definition at line 87 of file nsComponentManagerUtils.h.

Definition at line 123 of file nsComponentManagerUtils.h.

Definition at line 150 of file nsINIParser.h.

Header* NS_COM_GLUE::mHdr [protected]

Definition at line 124 of file nsTArray.h.

nsISupports * NS_COM_GLUE::mOuter [private]

Definition at line 86 of file nsComponentManagerUtils.h.

Definition at line 77 of file nsWeakReference.h.

nsISupports * NS_COM_GLUE::mRawPtr [private]

Definition at line 357 of file nsCOMPtr.h.

Definition at line 121 of file nsWeakReference.h.

Definition at line 149 of file nsINIParser.h.

nsISupports* NS_COM_GLUE::mSource [private]

Definition at line 71 of file nsIInterfaceRequestorUtils.h.

Definition at line 80 of file nsIWeakReferenceUtils.h.

const Header NS_COM_GLUE::sEmptyHdr [static, protected]

Definition at line 120 of file nsTArray.h.


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