3 * Copyright 2003, OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
7 #ifndef LDAP_ATTRTYPE_H
8 #define LDAP_ATTRTYPE_H
10 #include <ldap_schema.h>
13 #include "StringList.h"
15 #define SCHEMA_PARSE_FLAG 0x03
21 * Represents the Attribute Type (from LDAP schema)
40 LDAPAttrType (const LDAPAttrType& oc);
43 * Constructs new object and fills the data structure by parsing the
45 * @param at_item description of attribute type is string returned
46 * by the search command. It is in the form:
47 * "( SuSE.YaST.Attr:19 NAME ( 'skelDir' ) DESC ''
48 * EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )"
50 LDAPAttrType (string at_item);
55 virtual ~LDAPAttrType();
59 * Returns attribute description
61 string getDesc() const;
64 * Returns attribute oid
66 string getOid() const;
69 * Returns attribute name (first one if there are more of them)
71 string getName() const;
74 * Returns all attribute names
76 StringList getNames() const;
79 * Returns true if attribute type allows only single value
81 bool isSingle() const;
84 * Return the 'usage' value:
85 * (0=userApplications, 1=directoryOperation, 2=distributedOperation,
88 int getUsage () const;
90 void setNames (char **at_names);
91 void setDesc (char *at_desc);
92 void setOid (char *at_oid);
93 void setSingle (int at_single_value);
94 void setUsage (int at_usage );
97 #endif // LDAP_ATTRTYPE_H