From b527294153be3b79563c82c66102adc0004736c0 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 19:54:12 +0200 Subject: Adding upstream version 2.6.7+dfsg. Signed-off-by: Daniel Baumann --- contrib/ldapc++/src/LDAPSchema.h | 73 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 contrib/ldapc++/src/LDAPSchema.h (limited to 'contrib/ldapc++/src/LDAPSchema.h') diff --git a/contrib/ldapc++/src/LDAPSchema.h b/contrib/ldapc++/src/LDAPSchema.h new file mode 100644 index 0000000..c55c9af --- /dev/null +++ b/contrib/ldapc++/src/LDAPSchema.h @@ -0,0 +1,73 @@ +// $OpenLDAP$ +/* + * Copyright 2003-2022 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ + +#ifndef LDAP_SCHEMA_H +#define LDAP_SCHEMA_H + +#include +#include + +#include "LDAPObjClass.h" +#include "LDAPAttrType.h" + +/** + * Represents the LDAP schema + */ +class LDAPSchema{ + private : + /** + * map of object classes: index is name, value is LDAPObjClass object + */ + map object_classes; + + /** + * map of attribute types: index is name, value is LDAPAttrType object + */ + map attr_types; + + public : + + /** + * Constructs an empty object + */ + LDAPSchema(); + + /** + * Destructor + */ + virtual ~LDAPSchema(); + + /** + * Fill the object_classes map + * @param oc description of one objectclass (string returned by search + * command), in form: + * "( 1.2.3.4.5 NAME '' SUP STRUCTURAL + * DESC '' MUST ( ) MAY ( ))" + */ + void setObjectClasses (const StringList &oc); + + /** + * Fill the attr_types map + * @param at description of one attribute type + * (string returned by search command), in form: + * "( 1.2.3.4.6 NAME ( '' ) DESC '' + * EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )" + */ + void setAttributeTypes (const StringList &at); + + /** + * Returns object class object with given name + */ + LDAPObjClass getObjectClassByName (std::string name); + + /** + * Returns attribute type object with given name + */ + LDAPAttrType getAttributeTypeByName (string name); + +}; + +#endif // LDAP_SCHEMA_H -- cgit v1.2.3