]> git.sur5r.net Git - openldap/blobdiff - contrib/ldapc++/src/LDAPMessage.cpp
Entry rwlock is no longer needed as concurrency is managed
[openldap] / contrib / ldapc++ / src / LDAPMessage.cpp
index 1aaa819058a716a9d6fc4c437f507509c125c3ca..5c33f650d1d51cee2a1fd3cfcf3e15e7bcb3117f 100644 (file)
@@ -3,42 +3,59 @@
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 
-// $Id: LDAPMessage.cpp,v 1.6 2000/08/31 17:43:48 rhafer Exp $
 
 #include "LDAPMessage.h"
+
 #include "LDAPResult.h"
+#include "LDAPExtResult.h"
 #include "LDAPRequest.h"
 #include "LDAPSearchResult.h"
 #include "LDAPSearchReference.h"
 #include "debug.h"
 #include <iostream>
 
+using namespace std;
+
 LDAPMsg::LDAPMsg(LDAPMessage *msg){
-    DEBUG(LDAP_DEBUG_TRACE,"LDAPMsg::LDAPMsg()" << endl);
-       msgType=ldap_msgtype(msg);
+    DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPMsg::LDAPMsg()" << endl);
+    msgType=ldap_msgtype(msg);
+    m_hasControls=false;
 }
 
-LDAPMsg* LDAPMsg::create(LDAPRequest *req, LDAPMessage *msg){
+LDAPMsg* LDAPMsg::create(const LDAPRequest *req, LDAPMessage *msg){
     DEBUG(LDAP_DEBUG_TRACE,"LDAPMsg::create()" << endl);
-       switch(ldap_msgtype(msg)){
-               case LDAP_RES_SEARCH_ENTRY :
-                       return new LDAPSearchResult(req,msg);
-               break;
-               case LDAP_RES_SEARCH_REFERENCE :
-                       return new LDAPSearchReference(req, msg);
-               break;
-               default :
-                       return new LDAPResult(req, msg);
-       }
-       return 0;
+    switch(ldap_msgtype(msg)){
+        case SEARCH_ENTRY :
+            return new LDAPSearchResult(req,msg);
+        break;
+        case SEARCH_REFERENCE :
+            return new LDAPSearchReference(req, msg);
+        break;
+        case EXTENDED_RESPONSE :
+            return new LDAPExtResult(req,msg);
+        break;
+        default :
+            return new LDAPResult(req, msg);
+    }
+    return 0;
 }
 
 
 int LDAPMsg::getMessageType(){
-       return msgType;
+    DEBUG(LDAP_DEBUG_TRACE,"LDAPMsg::getMessageType()" << endl);
+    return msgType;
 }
 
 int LDAPMsg::getMsgID(){
-       return msgID;
+    DEBUG(LDAP_DEBUG_TRACE,"LDAPMsg::getMsgID()" << endl);
+    return msgID;
+}
+
+bool LDAPMsg::hasControls() const{
+    return m_hasControls;
+}
+
+const LDAPControlSet& LDAPMsg::getSrvControls() const {
+    return m_srvControls;
 }