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)
26 std::string desc, oid, superiorOid, equalityOid;
27 std::string orderingOid, substringOid, syntaxOid;
39 * Constructs new object and fills the data structure by parsing the
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 )"
46 LDAPAttrType (string at_item);
51 virtual ~LDAPAttrType();
55 * Returns attribute description
57 string getDesc() const;
60 * Returns attribute oid
62 string getOid() const;
65 * Returns attribute name (first one if there are more of them)
67 string getName() const;
70 * Returns all attribute names
72 StringList getNames() const;
75 * Returns true if attribute type allows only single value
77 bool isSingle() const;
80 * Return the 'usage' value:
81 * (0=userApplications, 1=directoryOperation, 2=distributedOperation,
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;
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 );
103 #endif // LDAP_ATTRTYPE_H