# Barry::ContactLdif Class Reference

`#include <ldif.h>`

Collaboration diagram for Barry::ContactLdif:

[legend]

List of all members.

## Detailed Description

Class for generating LDIF output based on a Barry::Contact record object.

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.

## 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.

## 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...

## Member Function Documentation

bool Barry::ContactLdif::SetDNAttr | ( | const LdifAttribute & | name | ) |

Sets the LDIF attribute name to use when constructing the FQDN.

The FQDN field will take this name, and combine it with the baseDN from the constructor to produce a FQDN for the record.

Definition at line 254 of file ldif.cc.

void Barry::ContactLdif::DumpLdif | ( | std::ostream & | os,
|  | const Barry::Contact & | contact |
| ) |  |  | const

Output contact data to os in LDAP LDIF format.

Definition at line 652 of file ldif.cc.

References Barry::Contact::GetID().

Here is the call graph for this function:

The documentation for this class was generated from the following files:

- ldif.h
- ldif.cc