Classes | Public Member Functions

Barry::ContactLdif Class Reference

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

#include <ldif.h>

Collaboration diagram for Barry::ContactLdif:
Collaboration graph
[legend]

List of all members.

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.

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.


Member Function Documentation

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

Output contact data to os in LDAP LDIF format.

Definition at line 653 of file ldif.cc.

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 255 of file ldif.cc.


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