3 * Copyright 2003, OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
8 #include "LDAPAttrType.h"
11 LDAPAttrType::LDAPAttrType(){
12 DEBUG(LDAP_DEBUG_CONSTRUCT,
13 "LDAPAttrType::LDAPAttrType( )" << endl);
17 names = StringList ();
22 LDAPAttrType::LDAPAttrType (const LDAPAttrType &at){
23 DEBUG(LDAP_DEBUG_CONSTRUCT,
24 "LDAPAttrType::LDAPAttrType( )" << endl);
33 LDAPAttrType::LDAPAttrType (string at_item) {
35 DEBUG(LDAP_DEBUG_CONSTRUCT,
36 "LDAPAttrType::LDAPAttrType( )" << endl);
41 a = ldap_str2attributetype (at_item.c_str(), &ret, &errp,SCHEMA_PARSE_FLAG);
44 this->setNames( a->at_names );
45 this->setDesc( a->at_desc );
46 this->setOid( a->at_oid );
47 this->setSingle( a->at_single_value );
48 this->setUsage( a->at_usage );
53 LDAPAttrType::~LDAPAttrType() {
54 DEBUG(LDAP_DEBUG_DESTROY,"LDAPAttrType::~LDAPAttrType()" << endl);
57 void LDAPAttrType::setSingle (int at_single) {
58 single = (at_single == 1);
61 void LDAPAttrType::setNames (char **at_names) {
62 names = StringList (at_names);
65 void LDAPAttrType::setDesc (char *at_desc) {
71 void LDAPAttrType::setOid (char *at_oid) {
77 void LDAPAttrType::setUsage (int at_usage) {
81 bool LDAPAttrType::isSingle() const {
85 string LDAPAttrType::getOid() const {
89 string LDAPAttrType::getDesc() const {
93 StringList LDAPAttrType::getNames() const {
97 string LDAPAttrType::getName() const {
102 return *(names.begin());
105 int LDAPAttrType::getUsage() const {