* replaced {first,next}Attribute() with getAttributes which returns an array: threadsafe and more useful from JS.

* added an emacs mode line and reindented.

* improved doxygen comments to include nsresult errors thrown


git-svn-id: svn://10.0.0.236/trunk@80117 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dmose%mozilla.org 2000-09-29 00:53:29 +00:00
parent 76477e7be7
commit afe7807e71

View File

@ -1,4 +1,5 @@
/*
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
@ -16,7 +17,7 @@
* Copyright (C) 2000 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s): Dan Mosedale <dmose@mozilla.org>
* Contributor(s): Dan Mosedale <dmose@mozilla.org> (original author)
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
@ -48,34 +49,54 @@ interface nsILDAPMessage : nsISupports
/**
* Initializes a message.
*
* @param aConnection The connection this message lives on.
* @param aMsgHandle The native LDAPMessage to be wrapped.
* @param aConnection The connection this message lives on.
* @param aMsgHandle The native LDAPMessage to be wrapped.
*
* @exception NS_ERROR_INVALID_POINTER
* @exception NS_ERROR_FAILURE Err getting connection handle.
* @exception NS_ERROR_FAILURE Err getting connection handle.
*/
[noscript] void init(in nsILDAPConnection aConnection,
in ldapMsgHandle aMsgHandle);
in ldapMsgHandle aMsgHandle);
// wrapper for ldap_get_dn
//
// XXX - currently must use ldap_mem_free to free
//
/**
* The Distinguished Name of the entry associated with this message.
* Wrapper for ldap_get_dn().
*
* @exception NS_ERROR_OUT_OF_MEMORY ran out of memory
* @exception NS_ERROR_ILLEGAL_VALUE null pointer passed in
* @exception NS_ERROR_LDAP_DECODING_ERROR problem during BER-decoding
* @exception NS_ERROR_UNEXPECTED bug or memory corruption
*/
readonly attribute string dn;
// wrappers for ldap_{first,next}_attribute
//
// XXX - currently must use ldap_mem_free to free the results
//
string firstAttribute();
string nextAttribute();
/**
* wrapper for ldap_{first,next}_attribute()
*
* @exception NS_ERROR_OUT_OF_MEMORY
* @exception NS_ERROR_ILLEGAL_VALUE null pointer passed in
* @exception NS_ERROR_UNEXPECTED bug or memory corruption
* @exception NS_ERROR_LDAP_DECODING_ERROR problem during BER decoding
*
* @return array of all attributes in the current message
*/
void getAttributes(out unsigned long count,
[retval, array, size_is(count)] out string aAttributes);
// wrapper for ldap_get_values
//
// XXX - values must be freed with ldap_value_free
//
/**
* wrapper for ldap_get_values()
*
* XXXdmose - values must be freed with ldap_value_free
*
* @param attr The attribute whose values are to be returned
* @param count Number of values in the outbound array.
* @param values Array of values
*
* @exception NS_ERROR_UNEXPECTED Bug or memory corruption
* @exception NS_ERROR_LDAP_DECODING_ERROR Attribute not found or other
* decoding error.
*/
void getValues(in string attr, out unsigned long count,
[retval, array, size_is(count)] out string values);
[retval, array, size_is(count)] out string values);
// turn an error condition associated with this message into an LDAP
// errcode (wrapper around ldap_parse_result)