Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Attributes
nsLDAPURL Class Reference

#include <nsLDAPURL.h>

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

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSIURI
NS_DECL_NSILDAPURL 
nsLDAPURL ()
virtual ~nsLDAPURL ()
nsresult Init ()
void getAttributes (out unsigned long aCount,[retval, array, size_is(aCount)] out string aAttrs)
 Return all LDAP attributes currently set.
void setAttributes (in unsigned long aCount,[array, size_is(aCount)] in string aAttrs)
 Set the array of attributes, dropping whatever was there before.
void addAttribute (in string aAttribute)
 Add one attribute to the array of attributes to request.
void removeAttribute (in string aAttribute)
 Remove one attribute from the array of attributes to request.
boolean hasAttribute (in string aAttribute)
 Test if an attribute is in our list of attributes already.
boolean equals (in nsIURI other)
 URI equivalence test (not a strict string comparison).
boolean schemeIs (in string scheme)
 An optimization to do scheme checks without requiring the users of nsIURI to GetScheme, thereby saving extra allocating and freeing.
nsIURI clone ()
 Clones the current URI.
AUTF8String resolve (in AUTF8String relativePath)
 This method resolves a relative string into an absolute URI string, using this URI as the base.

Public Attributes

attribute AUTF8String dn
 The distinguished name of the URL (ie the base DN for the search).
attribute long scope
 The scope of the search.
const long SCOPE_BASE = 0
 Search just the base object.
const long SCOPE_ONELEVEL = 1
 Search only the children of the base object.
const long SCOPE_SUBTREE = 2
 Search the entire subtree under and including the base object.
attribute AUTF8String filter
 The search filter.
attribute unsigned long options
 Any options defined for this URL (check options using a bitwise and)
const unsigned long OPT_SECURE = 0x01
 If this is set/true, this is an ldaps: URL, not an ldap: URL.
attribute AUTF8String spec
 Returns a string representation of the URI.
readonly attribute AUTF8String prePath
 The prePath (eg.
attribute ACString scheme
 The Scheme is the protocol to which this URI refers.
attribute AUTF8String userPass
 The username:password (or username only if value doesn't contain a ':')
attribute AUTF8String username
 The optional username and password, assuming the preHost consists of username:password.
attribute AUTF8String password
attribute AUTF8String hostPort
 The host:port (or simply the host, if port == -1).
attribute AUTF8String host
 The host is the internet domain name to which this URI refers.
attribute long port
 A port value of -1 corresponds to the protocol's default port (eg.
attribute AUTF8String path
 The path, typically including at least a leading '/' (but may also be empty, depending on the protocol).
readonly attribute ACString asciiSpec
 The URI spec with an ASCII compatible encoding.
readonly attribute ACString asciiHost
 The URI host with an ASCII compatible encoding.
readonly attribute ACString originCharset
 The charset of the document from which this URI originated.

Protected Attributes

nsCString mHost
PRInt32 mPort
nsCString mDN
PRInt32 mScope
nsCString mFilter
PRUint32 mOptions
nsCStringArray * mAttributes

Detailed Description

Definition at line 52 of file nsLDAPURL.h.


Constructor & Destructor Documentation

Definition at line 56 of file nsLDAPURL.cpp.

nsLDAPURL::~nsLDAPURL ( ) [virtual]

Definition at line 64 of file nsLDAPURL.cpp.

{
    // Delete the array of attributes
    delete mAttributes;
}

Member Function Documentation

void nsILDAPURL::addAttribute ( in string  aAttribute) [inherited]

Add one attribute to the array of attributes to request.

If the attribute is already in our array, this becomes a noop.

Parameters:
aAttributeAn LDAP attribute (e.g. "cn")
nsIURI nsIURI::clone ( ) [inherited]

Clones the current URI.

For some protocols, this is more than just an optimization. For example, under MacOS, the spec of a file URL does not necessarily uniquely identify a file since two volumes could share the same name.

Here is the caller graph for this function:

boolean nsIURI::equals ( in nsIURI  other) [inherited]

URI equivalence test (not a strict string comparison).

eg. http://foo.com:80/ == http://foo.com/

void nsILDAPURL::getAttributes ( out unsigned long  aCount,
[retval, array, size_is(aCount)] out string  aAttrs 
) [inherited]

Return all LDAP attributes currently set.

The empty array indicates that all attributes are requested.

Exceptions:
NS_ERROR_NULL_POINTERNULL pointer to GET method
NS_ERROR_OUT_OF_MEMORYRan out of memory
boolean nsILDAPURL::hasAttribute ( in string  aAttribute) [inherited]

Test if an attribute is in our list of attributes already.

Parameters:
aAttributeAn LDAP attribute (e.g. "cn")
Returns:
boolean Truth value
Exceptions:
NS_ERROR_NULL_POINTERNULL pointer to GET method

Definition at line 71 of file nsLDAPURL.cpp.

{
    if (!mAttributes) {
        mAttributes = new nsCStringArray();
        if (!mAttributes) {
            NS_ERROR("nsLDAPURL::Init: out of memory ");
            return NS_ERROR_OUT_OF_MEMORY;
        }
    }

    return NS_OK;
}
void nsILDAPURL::removeAttribute ( in string  aAttribute) [inherited]

Remove one attribute from the array of attributes to request.

If the attribute didn't exist in the array, this becomes a noop.

Parameters:
aAttributeAn LDAP attribute (e.g. "cn")
Exceptions:
NS_ERROR_OUT_OF_MEMORYRan out of memory
AUTF8String nsIURI::resolve ( in AUTF8String  relativePath) [inherited]

This method resolves a relative string into an absolute URI string, using this URI as the base.

NOTE: some implementations may have no concept of a relative URI.

boolean nsIURI::schemeIs ( in string  scheme) [inherited]

An optimization to do scheme checks without requiring the users of nsIURI to GetScheme, thereby saving extra allocating and freeing.

Returns true if the schemes match (case ignored).

void nsILDAPURL::setAttributes ( in unsigned long  aCount,
[array, size_is(aCount)] in string  aAttrs 
) [inherited]

Set the array of attributes, dropping whatever was there before.

Parameters:
aAttrsAn array of LDAP attributes
Exceptions:
NS_ERROR_OUT_OF_MEMORYRan out of memory

Member Data Documentation

readonly attribute ACString nsIURI::asciiHost [inherited]

The URI host with an ASCII compatible encoding.

Follows the IDNA draft spec for converting internationalized domain names (UTF-8) to ASCII for compatibility with existing internet infrasture.

Definition at line 220 of file nsIURI.idl.

readonly attribute ACString nsIURI::asciiSpec [inherited]

The URI spec with an ASCII compatible encoding.

Host portion follows the IDNA draft spec. Other parts are URL-escaped per the rules of RFC2396. The result is strictly ASCII.

Definition at line 213 of file nsIURI.idl.

attribute AUTF8String nsILDAPURL::dn [inherited]

The distinguished name of the URL (ie the base DN for the search).

This string is expected to be a valid UTF8 string.

for the getter:

Exceptions:
NS_ERROR_NULL_POINTERNULL pointer to GET method
NS_ERROR_OUT_OF_MEMORYRan out of memory

Definition at line 63 of file nsILDAPURL.idl.

attribute AUTF8String nsILDAPURL::filter [inherited]

The search filter.

"(objectClass=*)" is the default.

Definition at line 136 of file nsILDAPURL.idl.

attribute AUTF8String nsIURI::host [inherited]

The host is the internet domain name to which this URI refers.

It could be an IPv4 (or IPv6) address literal. If supported, it could be a non-ASCII internationalized domain name.

Characters are NOT escaped.

Definition at line 152 of file nsIURI.idl.

attribute AUTF8String nsIURI::hostPort [inherited]

The host:port (or simply the host, if port == -1).

Characters are NOT escaped.

Definition at line 143 of file nsIURI.idl.

nsCStringArray* nsLDAPURL::mAttributes [protected]

Definition at line 70 of file nsLDAPURL.h.

Definition at line 66 of file nsLDAPURL.h.

Definition at line 68 of file nsLDAPURL.h.

Definition at line 64 of file nsLDAPURL.h.

Definition at line 69 of file nsLDAPURL.h.

Definition at line 65 of file nsLDAPURL.h.

Definition at line 67 of file nsLDAPURL.h.

const unsigned long nsILDAPURL::OPT_SECURE = 0x01 [inherited]

If this is set/true, this is an ldaps: URL, not an ldap: URL.

Definition at line 149 of file nsILDAPURL.idl.

attribute unsigned long nsILDAPURL::options [inherited]

Any options defined for this URL (check options using a bitwise and)

Exceptions:
NS_ERROR_NULL_POINTERNULL pointer to GET method
NS_ERROR_OUT_OF_MEMORYRan out of memory

Definition at line 144 of file nsILDAPURL.idl.

readonly attribute ACString nsIURI::originCharset [inherited]

The charset of the document from which this URI originated.

An empty value implies UTF-8.

If this value is something other than UTF-8 then the URI components (e.g., spec, prePath, username, etc.) will all be fully URL-escaped. Otherwise, the URI components may contain unescaped multibyte UTF-8 characters.

Definition at line 231 of file nsIURI.idl.

attribute AUTF8String nsIURI::password [inherited]

Definition at line 136 of file nsIURI.idl.

attribute AUTF8String nsIURI::path [inherited]

The path, typically including at least a leading '/' (but may also be empty, depending on the protocol).

Some characters may be escaped.

Definition at line 166 of file nsIURI.idl.

A port value of -1 corresponds to the protocol's default port (eg.

-1 implies port 80 for http URIs).

Definition at line 158 of file nsIURI.idl.

readonly attribute AUTF8String nsIURI::prePath [inherited]

The prePath (eg.

scheme://user:password:port) returns the string before the path. This is useful for authentication or managing sessions.

Some characters may be escaped.

Definition at line 114 of file nsIURI.idl.

attribute ACString nsIURI::scheme [inherited]

The Scheme is the protocol to which this URI refers.

The scheme is restricted to the US-ASCII charset per RFC2396.

Definition at line 120 of file nsIURI.idl.

The scope of the search.

defaults to SCOPE_BASE.

Exceptions:
NS_ERROR_NULL_POINTERNULL pointer to GET method
NS_ERROR_MALFORMED_URIIllegal base to SET method

Definition at line 116 of file nsILDAPURL.idl.

Search just the base object.

Definition at line 121 of file nsILDAPURL.idl.

Search only the children of the base object.

Definition at line 126 of file nsILDAPURL.idl.

Search the entire subtree under and including the base object.

Definition at line 131 of file nsILDAPURL.idl.

attribute AUTF8String nsIURI::spec [inherited]

Returns a string representation of the URI.

Setting the spec causes the new spec to be parsed, initializing the URI.

Some characters may be escaped.

Definition at line 106 of file nsIURI.idl.

attribute AUTF8String nsIURI::username [inherited]

The optional username and password, assuming the preHost consists of username:password.

Some characters may be escaped.

Definition at line 135 of file nsIURI.idl.

attribute AUTF8String nsIURI::userPass [inherited]

The username:password (or username only if value doesn't contain a ':')

Some characters may be escaped.

Definition at line 127 of file nsIURI.idl.


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