2003-06-24 14:05:03 -04:00
|
|
|
/*
|
|
|
|
|
* Copyright 2003, OpenLDAP Foundation, All Rights Reserved.
|
|
|
|
|
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef LDAP_OBJCLASS_H
|
|
|
|
|
#define LDAP_OBJCLASS_H
|
|
|
|
|
|
|
|
|
|
#include <ldap_schema.h>
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
#include "StringList.h"
|
|
|
|
|
|
|
|
|
|
#define SCHEMA_PARSE_FLAG 0x03
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
*/
|
|
|
|
|
LDAPObjClass (const LDAPObjClass& oc);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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 ))"
|
|
|
|
|
*/
|
|
|
|
|
LDAPObjClass (string oc_item);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Destructor
|
|
|
|
|
*/
|
|
|
|
|
virtual ~LDAPObjClass();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns object class description
|
|
|
|
|
*/
|
|
|
|
|
string getDesc ();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns object class oid
|
|
|
|
|
*/
|
|
|
|
|
string getOid ();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns object class name (first one if there are more of them)
|
|
|
|
|
*/
|
|
|
|
|
string getName ();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns all object class names
|
|
|
|
|
*/
|
|
|
|
|
StringList getNames();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns list of required attributes
|
|
|
|
|
*/
|
|
|
|
|
StringList getMust();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns list of allowed (and not required) attributes
|
|
|
|
|
*/
|
|
|
|
|
StringList getMay();
|
2003-06-25 14:12:06 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns list of the OIDs of the superior ObjectClasses
|
|
|
|
|
*/
|
|
|
|
|
StringList getSup();
|
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
|