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