ldapsdk 0.0.1
|
00001 // $OpenLDAP$ 00002 /* 00003 * Copyright 2000, OpenLDAP Foundation, All Rights Reserved. 00004 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file 00005 */ 00006 00007 00008 #ifndef LDAP_CONTROL_H 00009 #define LDAP_CONTROL_H 00010 #include <string> 00011 #include <ldap.h> 00012 00017 class LDAPCtrl{ 00018 public : 00027 LDAPCtrl(const char *oid, bool critical=false, const char *data=0, 00028 int length=0); 00029 00037 LDAPCtrl(const std::string& oid, bool critical, 00038 const std::string& data); 00039 00043 LDAPCtrl(const LDAPControl* ctrl); 00044 00048 ~LDAPCtrl(); 00049 00053 std::string getOID() const; 00054 00059 bool hasData() const; 00060 00064 std::string getData() const; 00065 00069 bool isCritical() const; 00070 00077 LDAPControl* getControlStruct() const; 00078 static void freeLDAPControlStruct(LDAPControl *ctrl); 00079 00080 private : 00081 std::string m_oid; 00082 std::string m_data; 00083 bool m_isCritical; 00084 bool m_noData; 00085 }; 00086 00087 #endif //LDAP_CONTROL_H