]> git.sur5r.net Git - openldap/blob - contrib/ldapc++/src/LDAPAttrType.h
use URIs instead of hostname/port
[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         int usage;
28         
29     public :
30
31         /**
32          * Constructor
33          */   
34         LDAPAttrType();
35
36         /**
37          * Copy constructor
38          */   
39         LDAPAttrType (const LDAPAttrType& oc);
40
41         /**
42          * Constructs new object and fills the data structure by parsing the
43          * argument.
44          * @param at_item description of attribute type is string returned
45          *  by the search command. It is in the form:
46          * "( SuSE.YaST.Attr:19 NAME ( 'skelDir' ) DESC ''
47          *    EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )"
48          */   
49         LDAPAttrType (string at_item);
50
51         /**
52          * Destructor
53          */
54         virtual ~LDAPAttrType();
55         
56         
57         /**
58          * Returns attribute description
59          */
60         string getDesc ();
61         
62         /**
63          * Returns attribute oid
64          */
65         string getOid ();
66
67         /**
68          * Returns attribute name (first one if there are more of them)
69          */
70         string getName ();
71
72         /**
73          * Returns all attribute names
74          */
75         StringList getNames();
76         
77         /**
78          * Returns true if attribute type allows only single value
79          */
80         bool isSingle();
81         
82         /**
83          * Return the 'usage' value:
84          * (0=userApplications, 1=directoryOperation, 2=distributedOperation, 
85          *  3=dSAOperation)
86          */
87         int getUsage ();
88
89         void setNames (char **at_names);
90         void setDesc (char *at_desc);
91         void setOid (char *at_oid);
92         void setSingle (int at_single_value);
93         void setUsage (int at_usage );
94 };
95
96 #endif // LDAP_ATTRTYPE_H