]> git.sur5r.net Git - openldap/blobdiff - contrib/ldapc++/src/LDAPUrl.h
Entry rwlock is no longer needed as concurrency is managed
[openldap] / contrib / ldapc++ / src / LDAPUrl.h
index e88d8cc2e781e38bfb7f7483acd670adf0bfabdd..f2522d945ae019842fe98becda313d7c1b208ee1 100644 (file)
@@ -3,32 +3,80 @@
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 
-// $Id: LDAPUrl.h,v 1.5 2000/08/31 17:43:49 rhafer Exp $
 
 #ifndef LDAP_URL_H
 #define LDAP_URL_H
 
 #include <ldap.h>
+#include <StringList.h>
 
+/**
+ * This class is used to analyze and store LDAP-Urls as returned by a
+ * LDAP-Server as Referrals and Search References. LDAP-URLs are defined
+ * in RFC1959 and have the following format: <BR>
+ * <code>
+ * ldap://host:port/baseDN[?attr[?scope[?filter]]] <BR>
+ * </code>
+ */
 class LDAPUrl{
-    
-    protected :
-        LDAPURLDesc *m_urlDesc;
-        char *m_urlString;
 
     public : 
-        LDAPUrl(char *url);
-        LDAPUrl(char *host, int port, char *dn, char **attrs, int scope=0,
-                char *filter=0);
+        /**
+         * Create a new object from a c-std::string that contains a LDAP-Url
+         */
+        LDAPUrl(const char *url);
+
+        /**
+         * Destructor
+         */
         ~LDAPUrl();
 
+        /**
+         * @return The part of the URL that is representing the network
+         * port
+         */
         int getPort() const;
+
+        /**
+         * @return The scope part of the URL is returned. 
+         */
         int getScope() const;
-        char* getURLString() const;
-        char* getHost() const;
-        char* getDN() const;
-        char* getFilter() const;
-        char** getAttrs() const;
+
+        /**
+         * @return The complete URL as a std::string
+         */
+        const std::string& getURLString() const;
+
+        /**
+         * @return The hostname or IP-Address of the destination host.
+         */
+        const std::string& getHost() const;
+
+        /**
+         * @return The Base-DN part of the URL
+         */
+        const std::string& getDN() const;
+
+        
+        /**
+         * @return The Filter part of the URL
+         */
+        const std::string& getFilter() const;
+
+        /**
+         * @return The List of attributes  that was in the URL
+         */
+        const StringList& getAttrs() const;
+    
+    protected :
+        int m_Port;
+        int m_Scope;
+        std::string m_Host;
+        std::string m_DN;
+        std::string m_Filter;
+        StringList m_Attrs;
+        LDAPURLDesc *m_urlDesc;
+        std::string m_urlString;
 };
 
 #endif //LDAP_URL_H