2008-03-28 07:05:10 -04:00
|
|
|
// $OpenLDAP$
|
2003-06-24 14:05:03 -04:00
|
|
|
/*
|
2011-03-28 21:08:19 -04:00
|
|
|
* Copyright 2003-2011 The OpenLDAP Foundation, All Rights Reserved.
|
2003-06-24 14:05:03 -04:00
|
|
|
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef LDAP_OBJCLASS_H
|
|
|
|
|
#define LDAP_OBJCLASS_H
|
|
|
|
|
|
|
|
|
|
#include <ldap_schema.h>
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
#include "StringList.h"
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Represents the Object Class (from LDAP schema)
|
|
|
|
|
*/
|
|
|
|
|
class LDAPObjClass{
|
|
|
|
|
private :
|
2003-06-25 14:12:06 -04:00
|
|
|
StringList names, must, may, sup;
|
2003-06-24 14:05:03 -04:00
|
|
|
string desc, oid;
|
|
|
|
|
int kind;
|
|
|
|
|
|
|
|
|
|
public :
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Constructs an empty object.
|
|
|
|
|
*/
|
|
|
|
|
LDAPObjClass();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Copy constructor
|
|
|
|
|
*/
|
2008-08-08 07:14:58 -04:00
|
|
|
LDAPObjClass( const LDAPObjClass& oc );
|
2003-06-24 14:05:03 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Constructs new object and fills the data structure by parsing the
|
|
|
|
|
* argument.
|
|
|
|
|
* @param oc_item description of object class is string returned
|
|
|
|
|
* by the search command. It is in the form:
|
|
|
|
|
* "( SuSE.YaST.OC:5 NAME 'userTemplate' SUP objectTemplate STRUCTURAL
|
|
|
|
|
* DESC 'User object template' MUST ( cn ) MAY ( secondaryGroup ))"
|
|
|
|
|
*/
|
2008-08-08 07:14:58 -04:00
|
|
|
LDAPObjClass (string oc_item, int flags = LDAP_SCHEMA_ALLOW_NO_OID |
|
|
|
|
|
LDAP_SCHEMA_ALLOW_QUOTED);
|
2003-06-24 14:05:03 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Destructor
|
|
|
|
|
*/
|
|
|
|
|
virtual ~LDAPObjClass();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns object class description
|
|
|
|
|
*/
|
2008-04-30 11:18:28 -04:00
|
|
|
string getDesc() const;
|
2003-06-24 14:05:03 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns object class oid
|
|
|
|
|
*/
|
2008-04-30 11:18:28 -04:00
|
|
|
string getOid() const;
|
2003-06-24 14:05:03 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns object class name (first one if there are more of them)
|
|
|
|
|
*/
|
2008-04-30 11:18:28 -04:00
|
|
|
string getName() const;
|
2003-06-24 14:05:03 -04:00
|
|
|
|
2004-01-22 11:26:38 -05:00
|
|
|
/**
|
|
|
|
|
* Returns object class kind: 0=ABSTRACT, 1=STRUCTURAL, 2=AUXILIARY
|
|
|
|
|
*/
|
2008-04-30 11:18:28 -04:00
|
|
|
int getKind() const;
|
2004-01-22 11:26:38 -05:00
|
|
|
|
2003-06-24 14:05:03 -04:00
|
|
|
/**
|
|
|
|
|
* Returns all object class names
|
|
|
|
|
*/
|
2008-04-30 11:18:28 -04:00
|
|
|
StringList getNames() const;
|
2003-06-24 14:05:03 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns list of required attributes
|
|
|
|
|
*/
|
2008-04-30 11:18:28 -04:00
|
|
|
StringList getMust() const;
|
2003-06-24 14:05:03 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns list of allowed (and not required) attributes
|
|
|
|
|
*/
|
2008-04-30 11:18:28 -04:00
|
|
|
StringList getMay() const;
|
2003-06-25 14:12:06 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns list of the OIDs of the superior ObjectClasses
|
|
|
|
|
*/
|
2008-04-30 11:18:28 -04:00
|
|
|
StringList getSup() const;
|
2003-06-24 14:05:03 -04:00
|
|
|
|
|
|
|
|
void setNames (char **oc_names);
|
|
|
|
|
void setMay (char **oc_may);
|
|
|
|
|
void setMust (char **oc_must);
|
|
|
|
|
void setDesc (char *oc_desc);
|
|
|
|
|
void setOid (char *oc_oid);
|
|
|
|
|
void setKind (int oc_kind);
|
2003-06-25 14:12:06 -04:00
|
|
|
void setSup (char **oc_sup);
|
2003-06-24 14:05:03 -04:00
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // LDAP_OBJCLASS_H
|