1/*	$NetBSD: LDAPSchema.h,v 1.1.1.2 2010/03/08 02:14:14 lukem Exp $	*/
2
3// OpenLDAP: pkg/ldap/contrib/ldapc++/src/LDAPSchema.h,v 1.1.8.2 2008/04/14 23:09:26 quanah Exp
4/*
5 * Copyright 2003, OpenLDAP Foundation, All Rights Reserved.
6 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
7 */
8
9#ifndef LDAP_SCHEMA_H
10#define LDAP_SCHEMA_H
11
12#include <string>
13#include <map>
14
15#include "LDAPObjClass.h"
16#include "LDAPAttrType.h"
17
18/**
19 * Represents the LDAP schema
20 */
21class LDAPSchema{
22    private :
23	/**
24	 * map of object classes: index is name, value is LDAPObjClass object
25	 */
26	map <string, LDAPObjClass> object_classes;
27
28	/**
29	 * map of attribute types: index is name, value is LDAPAttrType object
30	 */
31	map <string, LDAPAttrType> attr_types;
32
33    public :
34
35        /**
36         * Constructs an empty object
37         */
38        LDAPSchema();
39
40        /**
41         * Destructor
42         */
43        virtual ~LDAPSchema();
44
45        /**
46         * Fill the object_classes map
47	 * @param oc description of one objectclass (string returned by search
48	 * command), in form:
49	 * "( 1.2.3.4.5 NAME '<name>' SUP <supname> STRUCTURAL
50	 *    DESC '<description>' MUST ( <attrtype> ) MAY ( <attrtype> ))"
51         */
52	void setObjectClasses (const StringList &oc);
53
54	 /**
55         * Fill the attr_types map
56	 * @param at description of one attribute type
57	 *  (string returned by search command), in form:
58	 * "( 1.2.3.4.6 NAME ( '<name>' ) DESC '<desc>'
59	 *    EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )"
60         */
61	void setAttributeTypes (const StringList &at);
62
63	/**
64	 * Returns object class object with given name
65	 */
66	LDAPObjClass getObjectClassByName (std::string name);
67
68	/**
69	 * Returns attribute type object with given name
70	 */
71	LDAPAttrType getAttributeTypeByName (string name);
72
73};
74
75#endif // LDAP_SCHEMA_H
76