]> git.sur5r.net Git - openldap/blob - contrib/ldapc++/src/LDAPUrl.h
- some code cleanups
[openldap] / contrib / ldapc++ / src / LDAPUrl.h
1 /*
2  * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
3  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
4  */
5
6
7 #ifndef LDAP_URL_H
8 #define LDAP_URL_H
9
10 #include <ldap.h>
11 #include <StringList.h>
12
13 /**
14  * This class is used to analyze and store LDAP-Urls as returned by a
15  * LDAP-Server as Referrals and Search References. LDAP-URLs are defined
16  * in RFC1959 and have the following format: <BR>
17  * <code>
18  * ldap://host:port/baseDN[?attr[?scope[?filter]]] <BR>
19  * </code>
20  */
21 class LDAPUrl{
22
23     public : 
24         /**
25          * Create a new object from a c-string that contains a LDAP-Url
26          */
27         LDAPUrl(const char *url);
28
29         /**
30          * Destructor
31          */
32         ~LDAPUrl();
33
34         /**
35          * @return The part of the URL that is representing the network
36          * port
37          */
38         int getPort() const;
39
40         /**
41          * @return The scope part of the URL is returned. 
42          */
43         int getScope() const;
44
45         /**
46          * @return The complete URL as a string
47          */
48         const std::string& getURLString() const;
49
50         /**
51          * @return The hostname or IP-Address of the destination host.
52          */
53         const std::string& getHost() const;
54
55         /**
56          * @return The Base-DN part of the URL
57          */
58         const std::string& getDN() const;
59
60         
61         /**
62          * @return The Filter part of the URL
63          */
64         const std::string& getFilter() const;
65
66         /**
67          * @return The List of attributes  that was in the URL
68          */
69         const StringList& getAttrs() const;
70     
71     protected :
72         int m_Port;
73         int m_Scope;
74         std::string m_Host;
75         std::string m_DN;
76         std::string m_Filter;
77         StringList m_Attrs;
78         LDAPURLDesc *m_urlDesc;
79         std::string m_urlString;
80 };
81
82 #endif //LDAP_URL_H