Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions
nsRegistry Struct Reference

#include <nsRegistry.h>

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

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSIREGISTRY
NS_DECL_NSIREGISTRYGETTER int 
SetBufferSize (int bufsize)
 nsRegistry ()
void open (in nsIFile regFile)
void openWellKnownRegistry (in nsWellKnownRegistry regid)
void flush ()
boolean isOpen ()
nsRegistryKey addKey (in nsRegistryKey baseKey, in wstring keyname)
nsRegistryKey getKey (in nsRegistryKey baseKey, in wstring keyname)
void removeKey (in nsRegistryKey baseKey, in wstring keyname)
wstring getString (in nsRegistryKey baseKey, in wstring valname)
void setString (in nsRegistryKey baseKey, in wstring valname, in wstring value)
string getStringUTF8 (in nsRegistryKey baseKey, in string path)
void setStringUTF8 (in nsRegistryKey baseKey, in string path, in string value)
void getBytesUTF8 (in nsRegistryKey baseKey, in string path, out PRUint32 length,[retval, array, size_is(length)] out PRUint8 valueArray)
void setBytesUTF8 (in nsRegistryKey baseKey, in string path, in PRUint32 length,[array, size_is(length)] in PRUint8 valueArray)
PRInt32 getInt (in nsRegistryKey baseKey, in string path)
void setInt (in nsRegistryKey baseKey, in string path, in PRInt32 value)
PRInt64 getLongLong (in nsRegistryKey baseKey, in string path)
void setLongLong (in nsRegistryKey baseKey, in string path, inout PRInt64 value)
nsRegistryKey addSubtree (in nsRegistryKey baseKey, in string path)
 addSubtree() and friends need to be renamed to addKeyUTF8().
void removeSubtree (in nsRegistryKey baseKey, in string path)
nsRegistryKey getSubtree (in nsRegistryKey baseKey, in string path)
nsRegistryKey addSubtreeRaw (in nsRegistryKey baseKey, in string path)
void removeSubtreeRaw (in nsRegistryKey baseKey, in string path)
nsRegistryKey getSubtreeRaw (in nsRegistryKey baseKey, in string path)
nsIEnumerator enumerateSubtrees (in nsRegistryKey baseKey)
nsIEnumerator enumerateAllSubtrees (in nsRegistryKey baseKey)
nsIEnumerator enumerateValues (in nsRegistryKey baseKey)
unsigned long getValueType (in nsRegistryKey baseKey, in string path)
PRUint32 getValueLength (in nsRegistryKey baseKey, in string path)
void deleteValue (in nsRegistryKey baseKey, in string path)
void escapeKey ([array, size_is(length)] in PRUint8 key, in PRUint32 terminator, inout PRUint32 length,[retval, array, size_is(length)] out PRUint8 escaped)
 escapeKey() takes arbitrary binary data and converts it into valid ASCII which can be used as registry key or value names
void unescapeKey ([array, size_is(length)] in PRUint8 escaped, in PRUint32 terminator, inout PRUint32 length,[retval, array, size_is(length)] out PRUint8 key)
void pack ()
void getStringUTF8IntoBuffer (in nsRegistryKey baseKey, in string path, inout char buf, inout PRUint32 length)
 Get a string value of attribute valname in widestring or utf8 format.
void getBytesUTF8IntoBuffer (in nsRegistryKey baseKey, in string path, inout PRUint8 buf, inout PRUint32 length)
 Get a a byte array value of attribute valname.

Public Attributes

const long None = 0
const long Users = 1
const long Common = 2
const long CurrentUser = 3
const long ApplicationComponentRegistry = 1
const long ApplicationRegistry = 2
const long ApplicationCustomRegistry = -1
const unsigned long String = 1
const unsigned long Int32 = 2
const unsigned long Bytes = 3
const unsigned long File = 4
attribute string currentUserName

Protected Member Functions

NS_IMETHOD Close ()

Protected Attributes

HREG mReg
nsCOMPtr< nsIFilemCurRegFile
nsWellKnownRegistry mCurRegID

Private Member Functions

 ~nsRegistry ()

Detailed Description

Definition at line 48 of file nsRegistry.h.


Constructor & Destructor Documentation

nsRegistry::~nsRegistry ( ) [private]

Definition at line 388 of file nsRegistry.cpp.

                        {
    if( mReg ) {
        Close();
    }
#ifdef EXTRA_THREADSAFE
    if (mregLock) {
        PR_DestroyLock(mregLock);
    }
#endif
    NR_ShutdownRegistry();
    return;
}

Here is the call graph for this function:


Member Function Documentation

nsRegistryKey nsIRegistry::addKey ( in nsRegistryKey  baseKey,
in wstring  keyname 
) [inherited]
nsRegistryKey nsIRegistry::addSubtree ( in nsRegistryKey  baseKey,
in string  path 
) [inherited]

addSubtree() and friends need to be renamed to addKeyUTF8().

If you are using these forms make sure you pass UTF8 data

nsRegistryKey nsIRegistry::addSubtreeRaw ( in nsRegistryKey  baseKey,
in string  path 
) [inherited]

Definition at line 598 of file nsRegistry.cpp.

                                {
    REGERR err = REGERR_OK;
    if( mReg ) {
        PR_Lock(mregLock);
        err = NR_RegClose( mReg );
        PR_Unlock(mregLock);
        mReg = 0;
        mCurRegFile = nsnull;
        mCurRegID = 0;
    }
    return regerr2nsresult( err );
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIRegistry::deleteValue ( in nsRegistryKey  baseKey,
in string  path 
) [inherited]
void nsIRegistry::escapeKey ( [array, size_is(length)] in PRUint8  key,
in PRUint32  terminator,
inout PRUint32  length,
[retval, array, size_is(length)] out PRUint8  escaped 
) [inherited]

escapeKey() takes arbitrary binary data and converts it into valid ASCII which can be used as registry key or value names

void nsIRegistry::flush ( ) [inherited]
void nsIRegistry::getBytesUTF8 ( in nsRegistryKey  baseKey,
in string  path,
out PRUint32  length,
[retval, array, size_is(length)] out PRUint8  valueArray 
) [inherited]
void nsIRegistryGetter::getBytesUTF8IntoBuffer ( in nsRegistryKey  baseKey,
in string  path,
inout PRUint8  buf,
inout PRUint32  length 
) [inherited]

Get a a byte array value of attribute valname.

Returns:
NS_OK on success. buf has the string value copied into it. length is updated to actual number of bytes copied into buf. NS_ERROR_REG_BUFFER_TOO_SMALL if not enough buffer space. length is updated to actual length in PRUint8s including terminating NULL and buf will be unchanged. NS_ERROR_FAILURE if an unknown error happened. state of buf and length undefined. various other failure codes otherwise. buf and length wont be updated.
PRInt32 nsIRegistry::getInt ( in nsRegistryKey  baseKey,
in string  path 
) [inherited]
nsRegistryKey nsIRegistry::getKey ( in nsRegistryKey  baseKey,
in wstring  keyname 
) [inherited]
PRInt64 nsIRegistry::getLongLong ( in nsRegistryKey  baseKey,
in string  path 
) [inherited]
wstring nsIRegistry::getString ( in nsRegistryKey  baseKey,
in wstring  valname 
) [inherited]
string nsIRegistry::getStringUTF8 ( in nsRegistryKey  baseKey,
in string  path 
) [inherited]
void nsIRegistryGetter::getStringUTF8IntoBuffer ( in nsRegistryKey  baseKey,
in string  path,
inout char  buf,
inout PRUint32  length 
) [inherited]

Get a string value of attribute valname in widestring or utf8 format.

Returns:
NS_OK on success. buf has the string value copied into it. length is NOT changed. NS_ERROR_REG_BUFFER_TOO_SMALL if not enough buffer space. length is updated to actual length in chars including terminating NULL and buf will be unchanged. NS_ERROR_FAILURE if an unknown error happened. state of buf and length undefined. various failure codes otherwise. buf and length wont be updated.
nsRegistryKey nsIRegistry::getSubtree ( in nsRegistryKey  baseKey,
in string  path 
) [inherited]
nsRegistryKey nsIRegistry::getSubtreeRaw ( in nsRegistryKey  baseKey,
in string  path 
) [inherited]
PRUint32 nsIRegistry::getValueLength ( in nsRegistryKey  baseKey,
in string  path 
) [inherited]
unsigned long nsIRegistry::getValueType ( in nsRegistryKey  baseKey,
in string  path 
) [inherited]
boolean nsIRegistry::isOpen ( ) [inherited]
void nsIRegistry::open ( in nsIFile  regFile) [inherited]
void nsIRegistry::pack ( ) [inherited]
void nsIRegistry::removeKey ( in nsRegistryKey  baseKey,
in wstring  keyname 
) [inherited]
void nsIRegistry::removeSubtree ( in nsRegistryKey  baseKey,
in string  path 
) [inherited]
void nsIRegistry::removeSubtreeRaw ( in nsRegistryKey  baseKey,
in string  path 
) [inherited]

Definition at line 1563 of file nsRegistry.cpp.

{
    int newSize;
    // set the file buffer size
    PR_Lock(mregLock);
    newSize = NR_RegSetBufferSize( mReg, bufsize );
    PR_Unlock(mregLock);
    return newSize;
}
void nsIRegistry::setBytesUTF8 ( in nsRegistryKey  baseKey,
in string  path,
in PRUint32  length,
[array, size_is(length)] in PRUint8  valueArray 
) [inherited]
void nsIRegistry::setInt ( in nsRegistryKey  baseKey,
in string  path,
in PRInt32  value 
) [inherited]
void nsIRegistry::setLongLong ( in nsRegistryKey  baseKey,
in string  path,
inout PRInt64  value 
) [inherited]
void nsIRegistry::setString ( in nsRegistryKey  baseKey,
in wstring  valname,
in wstring  value 
) [inherited]
void nsIRegistry::setStringUTF8 ( in nsRegistryKey  baseKey,
in string  path,
in string  value 
) [inherited]
void nsIRegistry::unescapeKey ( [array, size_is(length)] in PRUint8  escaped,
in PRUint32  terminator,
inout PRUint32  length,
[retval, array, size_is(length)] out PRUint8  key 
) [inherited]

Member Data Documentation

Definition at line 53 of file nsIRegistry.idl.

Definition at line 57 of file nsIRegistry.idl.

Definition at line 54 of file nsIRegistry.idl.

const unsigned long nsIRegistry::Bytes = 3 [inherited]

Definition at line 100 of file nsIRegistry.idl.

const long nsIRegistry::Common = 2 [inherited]

Definition at line 50 of file nsIRegistry.idl.

Definition at line 51 of file nsIRegistry.idl.

Definition at line 114 of file nsIRegistry.idl.

const unsigned long nsIRegistry::File = 4 [inherited]

Definition at line 101 of file nsIRegistry.idl.

const unsigned long nsIRegistry::Int32 = 2 [inherited]

Definition at line 99 of file nsIRegistry.idl.

Definition at line 71 of file nsRegistry.h.

Definition at line 72 of file nsRegistry.h.

HREG nsRegistry::mReg [protected]

Definition at line 67 of file nsRegistry.h.

const long nsIRegistry::None = 0 [inherited]

Definition at line 48 of file nsIRegistry.idl.

const unsigned long nsIRegistry::String = 1 [inherited]

Definition at line 98 of file nsIRegistry.idl.

const long nsIRegistry::Users = 1 [inherited]

Definition at line 49 of file nsIRegistry.idl.


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