1 | /* |
2 | A temporary copy to break dependency to KLDAP |
3 | |
4 | This file is part of libkldap. |
5 | Copyright (c) 2006 Sean Harmer <sh@theharmers.co.uk> |
6 | |
7 | This library is free software; you can redistribute it and/or |
8 | modify it under the terms of the GNU Library General Public |
9 | License as published by the Free Software Foundation; either |
10 | version 2 of the License, or (at your option) any later version. |
11 | |
12 | This library is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 | Library General Public License for more details. |
16 | |
17 | You should have received a copy of the GNU Library General Public License |
18 | along with this library; see the file COPYING.LIB. If not, write to |
19 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 | Boston, MA 02110-1301, USA. |
21 | */ |
22 | |
23 | #ifndef LDAPDN_P_H |
24 | #define LDAPDN_P_H |
25 | |
26 | #include <QtCore/QStringList> |
27 | |
28 | class LdapDN |
29 | { |
30 | public: |
31 | explicit LdapDN(); |
32 | explicit LdapDN( const QString &dn ); |
33 | |
34 | LdapDN( const LdapDN &that ); |
35 | LdapDN &operator=( const LdapDN &that ); |
36 | |
37 | ~LdapDN(); |
38 | |
39 | void clear(); |
40 | |
41 | bool isEmpty() const; |
42 | |
43 | /** |
44 | * \returns A QString representing the DN. |
45 | */ |
46 | QString toString() const; |
47 | |
48 | /** |
49 | * \param depth The depth of the DN to return using a zero-based index. |
50 | * \returns A QString representing the DN levels deep in the directory. |
51 | */ |
52 | QString toString( int depth ) const; |
53 | |
54 | /** |
55 | * \returns A QString representing the RDN of this DN. |
56 | */ |
57 | QString rdnString() const; |
58 | |
59 | /** |
60 | * \param depth The depth of the RDN to return using a zero-based index. |
61 | * \returns A QString representing the RDN levels deep in the directory. |
62 | */ |
63 | QString rdnString( int depth ) const; |
64 | |
65 | /** |
66 | * \returns True if this is a valid DN, false otherwise. |
67 | */ |
68 | bool isValid() const; |
69 | |
70 | /** |
71 | * \returns The depth of this DN in the directory. |
72 | */ |
73 | int depth() const; |
74 | |
75 | bool operator == ( const LdapDN &rhs ) const; |
76 | |
77 | bool operator != ( const LdapDN &rhs ) const; |
78 | |
79 | private: |
80 | class LdapDNPrivate; |
81 | LdapDNPrivate *const d; |
82 | }; |
83 | |
84 | #endif |
85 | |