]> git.sur5r.net Git - openldap/blob - contrib/ldapc++/src/LDAPAttrType.h
- removed unneeded copy constructor
[openldap] / contrib / ldapc++ / src / LDAPAttrType.h
1 // $OpenLDAP$
2 /*
3  * Copyright 2003, OpenLDAP Foundation, All Rights Reserved.
4  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5  */
6
7 #ifndef LDAP_ATTRTYPE_H
8 #define LDAP_ATTRTYPE_H
9
10 #include <ldap_schema.h>
11 #include <string>
12
13 #include "StringList.h"
14
15 #define SCHEMA_PARSE_FLAG    0x03
16
17
18 using namespace std;
19
20 /**
21  * Represents the Attribute Type (from LDAP schema)
22  */
23 class LDAPAttrType{
24     private :
25         StringList names;
26         std::string desc, oid, superiorOid, equalityOid;
27         std::string orderingOid, substringOid, syntaxOid;
28         bool single;
29         int usage;
30
31     public :
32
33         /**
34          * Constructor
35          */   
36         LDAPAttrType();
37
38         /**
39          * Constructs new object and fills the data structure by parsing the
40          * argument.
41          * @param at_item description of attribute type is string returned
42          *  by the search command. It is in the form:
43          * "( SuSE.YaST.Attr:19 NAME ( 'skelDir' ) DESC ''
44          *    EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )"
45          */   
46         LDAPAttrType (string at_item);
47
48         /**
49          * Destructor
50          */
51         virtual ~LDAPAttrType();
52         
53         
54         /**
55          * Returns attribute description
56          */
57         string getDesc() const;
58         
59         /**
60          * Returns attribute oid
61          */
62         string getOid() const;
63
64         /**
65          * Returns attribute name (first one if there are more of them)
66          */
67         string getName() const;
68
69         /**
70          * Returns all attribute names
71          */
72         StringList getNames() const;
73         
74         /**
75          * Returns true if attribute type allows only single value
76          */
77         bool isSingle() const;
78         
79         /**
80          * Return the 'usage' value:
81          * (0=userApplications, 1=directoryOperation, 2=distributedOperation, 
82          *  3=dSAOperation)
83          */
84         int getUsage () const;
85         std::string getSuperiorOid() const;
86         std::string getEqualityOid() const;
87         std::string getOrderingOid() const;
88         std::string getSubstringOid() const;
89         std::string getSyntaxOid() const;
90
91         void setNames( char **at_names);
92         void setDesc(const char *at_desc);
93         void setOid(const char *at_oid);
94         void setSingle(int at_single_value);
95         void setUsage(int at_usage );
96         void setSuperiorOid( const char *oid );
97         void setEqualityOid( const char *oid );
98         void setOrderingOid( const char *oid );
99         void setSubstringOid( const char *oid );
100         void setSyntaxOid( const char *oid );
101 };
102
103 #endif // LDAP_ATTRTYPE_H