WARNING: Most of this content (with the exception of the Mozilla 1.9 XPCOM reference) is very old, and can be expected to be out of date and possibly obsolete. For better XUL documentation, please visit the XUL hub at the Mozilla Developer Center.

nsILDAPBERElement

IID:409f5b31-c062-4d11-a35b-0a09e7967bf2
Inherits From:nsISupports

nsILDAPBERElement is a wrapper interface for a C-SDK BerElement object. Typically, this is used as an intermediate object to aid in the manual construction of a BER value. Once the construction is completed by calling methods on this object, an nsILDAPBERValue can be retrieved from the asValue attribute on this interface.

contains some documentation that mostly (but not exactly) matches the code that this wraps in section 17.


Constants

When returned from a parsing method, 0xffffffff is referred to has the parse-error semantic (ie TAG_LBER_ERROR); when passing it to a construction method, it is used to mean "pick the default tag for this type" (ie TAG_LBER_DEFAULT).
PRUint32 TAG_LBER_ERROR = -1
PRUint32 TAG_LBER_DEFAULT = -1
PRUint32 TAG_LBER_END_OF_SEQORSET = -2
BER encoding types and masks
PRUint32 TAG_LBER_PRIMITIVE = 0
The following two tags are carried over from the LDAP C SDK; their exact purpose there is not well documented. They both have the same value there as well.
PRUint32 TAG_LBER_CONSTRUCTED = 32
PRUint32 TAG_LBER_ENCODING_MASK = 32
PRUint32 TAG_LBER_BIG_TAG_MASK = 31
PRUint32 TAG_LBER_MORE_TAG_MASK = 128
General BER types we know about
PRUint32 TAG_LBER_BOOLEAN = 1
PRUint32 TAG_LBER_INTEGER = 2
PRUint32 TAG_LBER_BITSTRING = 3
PRUint32 TAG_LBER_OCTETSTRING = 4
PRUint32 TAG_LBER_NULL = 5
PRUint32 TAG_LBER_ENUMERATED = 10
PRUint32 TAG_LBER_SEQUENCE = 48
PRUint32 TAG_LBER_SET = 49

Properties

readonly nsILDAPBERValue asValue

An nsILDAPBERValue version of this element. Calls ber_flatten() under the hood.


Methods

void init ( nsILDAPBERValue value ) PRUint32 putSet ( ) PRUint32 putString ( AUTF8String string , PRUint32 tag ) void startSet ( PRUint32 tag )

void init ( nsILDAPBERValue value )

Initialize this object. Must be called before calling any other method on this interface.

Arguments:
value: value to preinitialize with; 0 for a new empty object

PRUint32 putSet ( )

Cause the entire set started by the last startSet() call to be written.

Returns:
number of bytes written

PRUint32 putString ( AUTF8String string , PRUint32 tag )

Write a string to this element.

Arguments:
string: string to write
tag: tag for this string (if TAG_LBER_DEFAULT is used, TAG_LBER_OCTETSTRING will be written).
Returns:
number of bytes written

void startSet ( PRUint32 tag )

Start a set. Sets may be nested.

Arguments:
tag: tag for this set (if TAG_LBER_DEFAULT is used, TAG_LBER_SET will be written).

Reference documentation is generated from Mozilla's source.