ldapsdk  0.0.1
LDAPException.h
Go to the documentation of this file.
1 // $OpenLDAP$
2 /*
3  * Copyright 2000-2013 The OpenLDAP Foundation, All Rights Reserved.
4  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5  */
6 
7 
8 #ifndef LDAP_EXCEPTION_H
9 #define LDAP_EXCEPTION_H
10 
11 #include <iostream>
12 #include <string>
13 #include <stdexcept>
14 
15 #include <LDAPUrlList.h>
16 
17 class LDAPAsynConnection;
18 
23 class LDAPException : public std::runtime_error
24 {
25 
26  public :
33  LDAPException(int res_code,
34  const std::string& err_string=std::string()) throw();
35 
42  LDAPException(const LDAPAsynConnection *lc) throw();
43 
47  virtual ~LDAPException() throw();
48 
52  int getResultCode() const throw();
53 
58  const std::string& getResultMsg() const throw();
59 
63  const std::string& getServerMsg() const throw();
64 
65 
66  virtual const char* what() const throw();
67 
72  friend std::ostream& operator << (std::ostream &s, LDAPException e) throw();
73 
74  private :
75  int m_res_code;
76  std::string m_res_string;
77  std::string m_err_string;
78 };
79 
85 {
86 
87  public :
91  LDAPReferralException(const LDAPUrlList& urls) throw();
92 
96  ~LDAPReferralException() throw();
97 
101  const LDAPUrlList& getUrls() throw();
102 
103  private :
104  LDAPUrlList m_urlList;
105 };
106 
107 #endif //LDAP_EXCEPTION_H
friend std::ostream & operator<<(std::ostream &s, LDAPException e)
This method can be used to dump the data of a LDAPResult-Object.
This class is only thrown as an Exception and used to signalize error conditions during LDAP-operatio...
Definition: LDAPException.h:23
~LDAPReferralException()
Destructor.
Definition: LDAPException.cpp:88
This class represents an asynchronous connection to an LDAP-Server.
Definition: LDAPAsynConnection.h:45
This container class is used to store multiple LDAPUrl-objects.
Definition: LDAPUrlList.h:16
virtual ~LDAPException()
Destructor.
Definition: LDAPException.cpp:49
LDAPException(int res_code, const std::string &err_string=std::string())
Constructs a LDAPException-object from the parameters.
const std::string & getResultMsg() const
Definition: LDAPException.cpp:58
LDAPReferralException(const LDAPUrlList &urls)
Creates an object that is initialized with a list of URLs.
Definition: LDAPException.cpp:83
const std::string & getServerMsg() const
Definition: LDAPException.cpp:63
const LDAPUrlList & getUrls()
Definition: LDAPException.cpp:92
int getResultCode() const
Definition: LDAPException.cpp:53
This class extends LDAPException and is used to signalize Referrals there were received during synchr...
Definition: LDAPException.h:84
virtual const char * what() const
Definition: LDAPException.cpp:68