Allow to pass LDAP_SCHEMA_-flags

This commit is contained in:
Ralf Haferkamp 2008-08-08 11:14:58 +00:00
parent 4028c83c67
commit 4aa7e7a5b8
4 changed files with 9 additions and 13 deletions

View File

@ -19,7 +19,7 @@ LDAPAttrType::LDAPAttrType(){
usage = 0;
}
LDAPAttrType::LDAPAttrType (string at_item) {
LDAPAttrType::LDAPAttrType (string at_item, int flags ) {
DEBUG(LDAP_DEBUG_CONSTRUCT,
"LDAPAttrType::LDAPAttrType( )" << endl);
@ -27,7 +27,7 @@ LDAPAttrType::LDAPAttrType (string at_item) {
LDAPAttributeType *a;
int ret;
const char *errp;
a = ldap_str2attributetype (at_item.c_str(), &ret, &errp,SCHEMA_PARSE_FLAG);
a = ldap_str2attributetype (at_item.c_str(), &ret, &errp, flags);
if (a) {
this->setNames( a->at_names );

View File

@ -12,9 +12,6 @@
#include "StringList.h"
#define SCHEMA_PARSE_FLAG 0x03
using namespace std;
/**
@ -43,7 +40,8 @@ class LDAPAttrType{
* "( SuSE.YaST.Attr:19 NAME ( 'skelDir' ) DESC ''
* EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )"
*/
LDAPAttrType (string at_item);
LDAPAttrType (string at_item, int flags = LDAP_SCHEMA_ALLOW_NO_OID |
LDAP_SCHEMA_ALLOW_QUOTED );
/**
* Destructor

View File

@ -33,7 +33,7 @@ LDAPObjClass::LDAPObjClass (const LDAPObjClass &oc){
sup = oc.sup;
}
LDAPObjClass::LDAPObjClass (string oc_item) {
LDAPObjClass::LDAPObjClass (string oc_item, int flags ) {
DEBUG(LDAP_DEBUG_CONSTRUCT,
"LDAPObjClass::LDAPObjClass( )" << endl);
@ -41,7 +41,7 @@ LDAPObjClass::LDAPObjClass (string oc_item) {
LDAPObjectClass *o;
int ret;
const char *errp;
o = ldap_str2objectclass ( oc_item.c_str(), &ret, &errp, SCHEMA_PARSE_FLAG);
o = ldap_str2objectclass ( oc_item.c_str(), &ret, &errp, flags );
if (o) {
this->setNames (o->oc_names);

View File

@ -12,9 +12,6 @@
#include "StringList.h"
#define SCHEMA_PARSE_FLAG 0x03
using namespace std;
/**
@ -36,7 +33,7 @@ class LDAPObjClass{
/**
* Copy constructor
*/
LDAPObjClass (const LDAPObjClass& oc);
LDAPObjClass( const LDAPObjClass& oc );
/**
* Constructs new object and fills the data structure by parsing the
@ -46,7 +43,8 @@ class LDAPObjClass{
* "( SuSE.YaST.OC:5 NAME 'userTemplate' SUP objectTemplate STRUCTURAL
* DESC 'User object template' MUST ( cn ) MAY ( secondaryGroup ))"
*/
LDAPObjClass (string oc_item);
LDAPObjClass (string oc_item, int flags = LDAP_SCHEMA_ALLOW_NO_OID |
LDAP_SCHEMA_ALLOW_QUOTED);
/**
* Destructor