#include <ldif.h>
Classes | |
struct | AccessPair |
struct | LdifAttribute |
struct | NameToFunc |
Used to create a List of supported Barry field names, including calculated names, such as full postal address. More... | |
Public Member Functions | |
bool | SetDNAttr (const LdifAttribute &name) |
Sets the LDIF attribute name to use when constructing the FQDN. | |
void | DumpLdif (std::ostream &os, const Barry::Contact &contact) const |
Output contact data to os in LDAP LDIF format. |
This class supports LDIF attribute mapping, and a heuristics mechanism for parsing LDIF fields that may not have consistent data.
To use this class, create an instance of it, then call DumpLdif(), passing the Contact record object to base the work on. Output will be written to the stream you provide. ReadLdif() goes in the other direction.
To override LDIF attribute mapping, call Map() or Unmap() as appropriate.
To get a list of supported Barry::Contact field names, call GetFieldNames(). This function returns a pointer to an array of ContactLdif::NameToFunc structures, ending with NameToFunc::name as null. You can cycle through the array with code like this:
for( ContactLdif::NameToFunc *n = o.GetFieldNames(); n->name; n++ ) { ... }
Note that all Get/Set functions used in attribute mapping are virtual, and can be overridden by a derived class. This includes the heuristics functions, which are called by DumpLdif().
Definition at line 64 of file ldif.h.
void Barry::ContactLdif::DumpLdif | ( | std::ostream & | os, | |
const Barry::Contact & | contact | |||
) | const |
Output contact data to os in LDAP LDIF format.
Definition at line 632 of file ldif.cc.
References Barry::Contact::GetID().
bool Barry::ContactLdif::SetDNAttr | ( | const LdifAttribute & | name | ) |