2008-03-28 07:05:10 -04:00
|
|
|
// $OpenLDAP$
|
2000-09-01 14:46:32 -04:00
|
|
|
/*
|
2012-01-01 10:07:45 -05:00
|
|
|
* Copyright 2000-2012 The OpenLDAP Foundation, All Rights Reserved.
|
2000-09-01 14:46:32 -04:00
|
|
|
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef LDAP_MOD_LIST_H
|
|
|
|
|
#define LDAP_MOD_LIST_H
|
|
|
|
|
|
|
|
|
|
#include <ldap.h>
|
|
|
|
|
#include <list>
|
2001-03-15 06:07:58 -05:00
|
|
|
#include <LDAPModification.h>
|
2000-09-01 14:46:32 -04:00
|
|
|
|
2001-02-19 06:34:28 -05:00
|
|
|
/**
|
|
|
|
|
* This container class is used to store multiple LDAPModification-objects.
|
|
|
|
|
*/
|
2000-09-01 14:46:32 -04:00
|
|
|
class LDAPModList{
|
2008-04-04 06:36:01 -04:00
|
|
|
typedef std::list<LDAPModification> ListType;
|
2000-09-01 14:46:32 -04:00
|
|
|
|
2008-04-04 06:36:01 -04:00
|
|
|
public :
|
2001-02-19 06:34:28 -05:00
|
|
|
/**
|
2002-04-23 11:28:11 -04:00
|
|
|
* Constructs an empty list.
|
2001-02-19 06:34:28 -05:00
|
|
|
*/
|
2004-02-03 12:11:17 -05:00
|
|
|
LDAPModList();
|
2001-02-19 06:34:28 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Copy-constructor
|
|
|
|
|
*/
|
|
|
|
|
LDAPModList(const LDAPModList&);
|
|
|
|
|
|
|
|
|
|
/**
|
2002-04-23 11:28:11 -04:00
|
|
|
* Adds one element to the end of the list.
|
2001-09-28 12:39:58 -04:00
|
|
|
* @param mod The LDAPModification to add to the std::list.
|
2001-02-19 06:34:28 -05:00
|
|
|
*/
|
2004-02-03 12:11:17 -05:00
|
|
|
void addModification(const LDAPModification &mod);
|
2001-02-19 06:34:28 -05:00
|
|
|
|
|
|
|
|
/**
|
2002-04-23 11:28:11 -04:00
|
|
|
* Translates the list to a 0-terminated array of
|
2001-02-19 06:34:28 -05:00
|
|
|
* LDAPMod-structures as needed by the C-API
|
|
|
|
|
*/
|
|
|
|
|
LDAPMod** toLDAPModArray();
|
2000-09-01 14:46:32 -04:00
|
|
|
|
2008-04-04 06:36:01 -04:00
|
|
|
/**
|
|
|
|
|
* @returns true, if the ModList contains no Operations
|
|
|
|
|
*/
|
|
|
|
|
bool empty() const;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @returns number of Modifications in the ModList
|
|
|
|
|
*/
|
|
|
|
|
unsigned int size() const;
|
|
|
|
|
|
|
|
|
|
private :
|
2004-02-03 12:11:17 -05:00
|
|
|
ListType m_modList;
|
2000-09-01 14:46:32 -04:00
|
|
|
};
|
|
|
|
|
#endif //LDAP_MOD_LIST_H
|
|
|
|
|
|
|
|
|
|
|