Logo Search packages:      
Sourcecode: barry version File versions  Download package

Barry::ContactLdif Class Reference

#include <ldif.h>

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 Types

typedef std::map
< LdifAttribute, AccessPair > 
typedef std::string(ContactLdif::* GetFunctionType )(const Barry::Contact &) const
typedef std::map< std::string,
std::string * > 
typedef void(ContactLdif::* SetFunctionType )(Barry::Contact &, const std::string &) const

Public Member Functions

virtual std::string Address1 (const Barry::Contact &con) const
virtual std::string Address2 (const Barry::Contact &con) const
virtual std::string Address3 (const Barry::Contact &con) const
virtual std::string City (const Barry::Contact &con) const
void ClearArrayState () const
virtual void ClearHeuristics ()
virtual std::string Company (const Barry::Contact &con) const
 ContactLdif (const std::string &baseDN)
virtual std::string Country (const Barry::Contact &con) const
virtual std::string DefaultCommunicationsMethod (const Barry::Contact &con) const
void DumpLdif (std::ostream &os, const Barry::Contact &contact) const
void DumpMap (std::ostream &os) const
virtual std::string Email (const Barry::Contact &con) const
virtual std::string Fax (const Barry::Contact &con) const
virtual std::string FirstName (const Barry::Contact &con) const
virtual std::string FQDN (const Barry::Contact &con) const
virtual std::string FullName (const Barry::Contact &con) const
const NameToFuncGetField (const std::string &fieldname) const
const NameToFuncGetFieldNames () const
std::string GetFieldReadName (GetFunctionType read) const
std::string GetFieldWriteName (SetFunctionType write) const
virtual std::string HomePhone (const Barry::Contact &con) const
virtual bool IsArrayFunc (GetFunctionType getf) const
virtual std::string JobTitle (const Barry::Contact &con) const
virtual std::string LastName (const Barry::Contact &con) const
void Map (const LdifAttribute &ldifname, GetFunctionType read, SetFunctionType write)
bool Map (const LdifAttribute &ldifname, const std::string &readField, const std::string &writeField)
virtual std::string MobilePhone (const Barry::Contact &con) const
virtual std::string Notes (const Barry::Contact &con) const
virtual std::string Pager (const Barry::Contact &con) const
virtual std::string Phone (const Barry::Contact &con) const
virtual std::string PIN (const Barry::Contact &con) const
virtual std::string PostalAddress (const Barry::Contact &con) const
virtual std::string PostalCode (const Barry::Contact &con) const
virtual std::string Province (const Barry::Contact &con) const
virtual std::string PublicKey (const Barry::Contact &con) const
bool ReadLdif (std::istream &is, Barry::Contact &contact)
virtual bool RunHeuristics (Barry::Contact &con)
virtual void SetAddress1 (Barry::Contact &con, const std::string &val) const
virtual void SetAddress2 (Barry::Contact &con, const std::string &val) const
virtual void SetAddress3 (Barry::Contact &con, const std::string &val) const
void SetBaseDN (const std::string &baseDN)
virtual void SetCity (Barry::Contact &con, const std::string &val) const
virtual void SetCompany (Barry::Contact &con, const std::string &val) const
virtual void SetCountry (Barry::Contact &con, const std::string &val) const
virtual void SetDefaultCommunicationsMethod (Barry::Contact &con, const std::string &val) const
bool SetDNAttr (const LdifAttribute &name)
virtual void SetEmail (Barry::Contact &con, const std::string &val) const
virtual void SetFax (Barry::Contact &con, const std::string &val) const
virtual void SetFirstName (Barry::Contact &con, const std::string &val) const
virtual void SetFQDN (Barry::Contact &con, const std::string &val) const
virtual void SetFullName (Barry::Contact &con, const std::string &val) const
virtual void SetHomePhone (Barry::Contact &con, const std::string &val) const
virtual void SetJobTitle (Barry::Contact &con, const std::string &val) const
virtual void SetLastName (Barry::Contact &con, const std::string &val) const
virtual void SetMobilePhone (Barry::Contact &con, const std::string &val) const
virtual void SetNotes (Barry::Contact &con, const std::string &val) const
bool SetObjectClass (const LdifAttribute &name, const std::string &objectClass)
bool SetObjectOrder (const LdifAttribute &name, int order)
virtual void SetPager (Barry::Contact &con, const std::string &val) const
virtual void SetPhone (Barry::Contact &con, const std::string &val) const
virtual void SetPIN (Barry::Contact &con, const std::string &val) const
virtual void SetPostalAddress (Barry::Contact &con, const std::string &val) const
virtual void SetPostalCode (Barry::Contact &con, const std::string &val) const
virtual void SetProvince (Barry::Contact &con, const std::string &val) const
virtual void SetPublicKey (Barry::Contact &con, const std::string &val) const
virtual void SetWorkPhone (Barry::Contact &con, const std::string &val) const
void Unmap (const LdifAttribute &ldifname)
virtual std::string WorkPhone (const Barry::Contact &con) const

Static Public Member Functions

static std::string MakeLdifData (const std::string &str)
static bool NeedsEncoding (const std::string &str)

Protected Member Functions

void DoWrite (Barry::Contact &con, const std::string &attr, const std::string &data)
void Hook (const std::string &ldifname, std::string *var)

Protected Attributes

std::string m_baseDN
std::string m_cn
std::string m_displayName
LdifAttribute m_dnAttr
unsigned int m_emailIndex
std::string m_givenName
HookMapType m_hookMap
AccessMapType m_map
std::string m_sn

Static Protected Attributes

static const NameToFunc FieldMap []


struct  AccessPair
struct  LdifAttribute
struct  NameToFunc

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

Generated by  Doxygen 1.6.0   Back to index