]> git.sur5r.net Git - openldap/blob - contrib/ldapc++/src/LDAPMessage.h
Initial check of the LDAP C++ SDK written by Ralf Haferkamp <rhafer@suse.de>
[openldap] / contrib / ldapc++ / src / LDAPMessage.h
1 /*
2  * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
3  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
4  */
5
6 // $Id: LDAPMessage.h,v 1.7 2000/08/31 17:43:48 rhafer Exp $
7
8 #ifndef LDAP_MSG_H
9 #define LDAP_MSG_H
10 #include <ldap.h>
11
12 //#include "LDAPConnection.h"
13
14 class LDAPRequest;
15 //! Represents an LDAPMsg returned from the server
16 /*!
17  * This class is normally not instantiated directly. Normally only
18  * its subclasses are used. The main feature of this class is the
19  * static method create() (see below)
20  */
21 class LDAPMsg{
22         private:
23                 int msgID;
24         protected:
25                 int msgType;
26                 LDAPMsg(LDAPMessage *msg);
27
28         public:
29
30         //public Constants defining the Message types
31         static const int BIND_RESPONSE=LDAP_RES_BIND;
32         static const int SEARCH_ENTRY=LDAP_RES_SEARCH_ENTRY;
33         static const int SEARCH_DONE=LDAP_RES_SEARCH_RESULT;
34         static const int SEARCH_REFERENCE=LDAP_RES_SEARCH_REFERENCE;
35         static const int MODIFY_RESPONSE=LDAP_RES_MODIFY;
36         static const int ADD_RESPONSE=LDAP_RES_ADD;
37         static const int DEL_RESPONSE=LDAP_RES_DELETE;
38         static const int MODDN_RESPONSE=LDAP_RES_MODDN;
39         static const int COMPARE_RESPONSE=LDAP_RES_COMPARE;
40         static const int EXTENDED_RESPONSE=LDAP_RES_EXTENDED;
41         
42                 virtual ~LDAPMsg() {}
43
44                 /*!
45                  * Based on msgtype-Value of the *msg-Parameter this method creates
46                  * an Object of one of the subtypes of LDAPMsg (e.g. LDAPSearchResult
47          * or LDAPResult) that represents the same Message as the
48          * *msg-Parameter. *msg is e.g. a Message returned by the C-API's
49          * ldap_result call.
50                  */
51                 static LDAPMsg* create(LDAPRequest *req, LDAPMessage *msg);     
52                 int getMessageType();
53         int getMsgID();
54 };
55 #endif //ifndef LDAP_MSG_H