3 * Copyright 2003-2014 The 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"
18 * Represents the Attribute Type (from LDAP schema)
23 std::string desc, oid, superiorOid, equalityOid;
24 std::string orderingOid, substringOid, syntaxOid;
36 * Constructs new object and fills the data structure by parsing the
38 * @param at_item description of attribute type is string returned
39 * by the search command. It is in the form:
40 * "( SuSE.YaST.Attr:19 NAME ( 'skelDir' ) DESC ''
41 * EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )"
43 LDAPAttrType (string at_item, int flags = LDAP_SCHEMA_ALLOW_NO_OID |
44 LDAP_SCHEMA_ALLOW_QUOTED );
49 virtual ~LDAPAttrType();
53 * Returns attribute description
55 string getDesc() const;
58 * Returns attribute oid
60 string getOid() const;
63 * Returns attribute name (first one if there are more of them)
65 string getName() const;
68 * Returns all attribute names
70 StringList getNames() const;
73 * Returns true if attribute type allows only single value
75 bool isSingle() const;
78 * Return the 'usage' value:
79 * (0=userApplications, 1=directoryOperation, 2=distributedOperation,
82 int getUsage () const;
83 std::string getSuperiorOid() const;
84 std::string getEqualityOid() const;
85 std::string getOrderingOid() const;
86 std::string getSubstringOid() const;
87 std::string getSyntaxOid() const;
89 void setNames( char **at_names);
90 void setDesc(const char *at_desc);
91 void setOid(const char *at_oid);
92 void setSingle(int at_single_value);
93 void setUsage(int at_usage );
94 void setSuperiorOid( const char *oid );
95 void setEqualityOid( const char *oid );
96 void setOrderingOid( const char *oid );
97 void setSubstringOid( const char *oid );
98 void setSyntaxOid( const char *oid );
101 #endif // LDAP_ATTRTYPE_H