Back to index

openldap  2.4.31
Public Member Functions | Private Attributes
LDAPAttrType Class Reference

Represents the Attribute Type (from LDAP schema) More...

#include <LDAPAttrType.h>

Collaboration diagram for LDAPAttrType:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 LDAPAttrType ()
 Constructor.
 LDAPAttrType (string at_item, int flags=LDAP_SCHEMA_ALLOW_NO_OID|LDAP_SCHEMA_ALLOW_QUOTED)
 Constructs new object and fills the data structure by parsing the argument.
virtual ~LDAPAttrType ()
 Destructor.
string getDesc () const
 Returns attribute description.
string getOid () const
 Returns attribute oid.
string getName () const
 Returns attribute name (first one if there are more of them)
StringList getNames () const
 Returns all attribute names.
bool isSingle () const
 Returns true if attribute type allows only single value.
int getUsage () const
 Return the 'usage' value: (0=userApplications, 1=directoryOperation, 2=distributedOperation, 3=dSAOperation)
std::string getSuperiorOid () const
std::string getEqualityOid () const
std::string getOrderingOid () const
std::string getSubstringOid () const
std::string getSyntaxOid () const
void setNames (char **at_names)
void setDesc (const char *at_desc)
void setOid (const char *at_oid)
void setSingle (int at_single_value)
void setUsage (int at_usage)
void setSuperiorOid (const char *oid)
void setEqualityOid (const char *oid)
void setOrderingOid (const char *oid)
void setSubstringOid (const char *oid)
void setSyntaxOid (const char *oid)

Private Attributes

StringList names
std::string desc
std::string oid
std::string superiorOid
std::string equalityOid
std::string orderingOid
std::string substringOid
std::string syntaxOid
bool single
int usage

Detailed Description

Represents the Attribute Type (from LDAP schema)

Definition at line 20 of file LDAPAttrType.h.


Constructor & Destructor Documentation

Constructor.

Definition at line 11 of file LDAPAttrType.cpp.

                          {
    DEBUG(LDAP_DEBUG_CONSTRUCT,
            "LDAPAttrType::LDAPAttrType( )" << endl);

    oid = string ();
    desc = string ();
    names = StringList ();
    single = false;
    usage = 0;
}

Constructs new object and fills the data structure by parsing the argument.

Parameters:
at_itemdescription of attribute type is string returned by the search command. It is in the form: "( SuSE.YaST.Attr:19 NAME ( 'skelDir' ) DESC '' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )"

Definition at line 22 of file LDAPAttrType.cpp.

                                                      { 

    DEBUG(LDAP_DEBUG_CONSTRUCT,
            "LDAPAttrType::LDAPAttrType( )" << endl);

    LDAPAttributeType *a;
    int ret;
    const char *errp;
    a = ldap_str2attributetype (at_item.c_str(), &ret, &errp, flags);

    if (a) {
       this->setNames( a->at_names );
       this->setDesc( a->at_desc );
       this->setOid( a->at_oid );
       this->setSingle( a->at_single_value );
       this->setUsage( a->at_usage );
        this->setSuperiorOid( a->at_sup_oid );
        this->setEqualityOid( a->at_equality_oid );
        this->setOrderingOid( a->at_ordering_oid );
        this->setSubstringOid( a->at_substr_oid );
        this->setSyntaxOid( a->at_syntax_oid );
    }
    // else? -> error
}

Here is the call graph for this function:

Destructor.

Definition at line 47 of file LDAPAttrType.cpp.

                            {
    DEBUG(LDAP_DEBUG_DESTROY,"LDAPAttrType::~LDAPAttrType()" << endl);
}

Member Function Documentation

string LDAPAttrType::getDesc ( ) const

Returns attribute description.

Definition at line 108 of file LDAPAttrType.cpp.

                                   {
    return desc;
}
std::string LDAPAttrType::getEqualityOid ( ) const

Definition at line 132 of file LDAPAttrType.cpp.

                                             {
    return equalityOid;
}
string LDAPAttrType::getName ( ) const

Returns attribute name (first one if there are more of them)

Definition at line 116 of file LDAPAttrType.cpp.

                                   {

    if (names.empty())
       return "";
    else
       return *(names.begin());
}

Here is the call graph for this function:

Returns all attribute names.

Definition at line 112 of file LDAPAttrType.cpp.

                                        {
    return names;
}

Here is the caller graph for this function:

string LDAPAttrType::getOid ( ) const

Returns attribute oid.

Definition at line 104 of file LDAPAttrType.cpp.

                                  {
    return oid;
}
std::string LDAPAttrType::getOrderingOid ( ) const

Definition at line 136 of file LDAPAttrType.cpp.

                                             {
    return orderingOid;
}
std::string LDAPAttrType::getSubstringOid ( ) const

Definition at line 140 of file LDAPAttrType.cpp.

                                              {
    return substringOid;
}
std::string LDAPAttrType::getSuperiorOid ( ) const

Definition at line 128 of file LDAPAttrType.cpp.

                                             {
    return superiorOid;
}
std::string LDAPAttrType::getSyntaxOid ( ) const

Definition at line 144 of file LDAPAttrType.cpp.

                                           {
    return syntaxOid;
}

Return the 'usage' value: (0=userApplications, 1=directoryOperation, 2=distributedOperation, 3=dSAOperation)

Definition at line 124 of file LDAPAttrType.cpp.

                                 {
    return usage;
}
bool LDAPAttrType::isSingle ( ) const

Returns true if attribute type allows only single value.

Definition at line 100 of file LDAPAttrType.cpp.

                                  {
    return single;
} 
void LDAPAttrType::setDesc ( const char *  at_desc)

Definition at line 59 of file LDAPAttrType.cpp.

                                               {
    desc = string ();
    if (at_desc)
       desc = at_desc;
}

Here is the caller graph for this function:

Definition at line 80 of file LDAPAttrType.cpp.

                                                  {
    if ( oid )
        equalityOid = oid;
}

Here is the caller graph for this function:

void LDAPAttrType::setNames ( char **  at_names)

Definition at line 55 of file LDAPAttrType.cpp.

                                              {
    names = StringList(at_names);
}

Here is the caller graph for this function:

void LDAPAttrType::setOid ( const char *  at_oid)

Definition at line 65 of file LDAPAttrType.cpp.

                                             {
    oid = string ();
    if (at_oid)
       oid = at_oid;
}

Here is the caller graph for this function:

Definition at line 85 of file LDAPAttrType.cpp.

                                                  {
    if ( oid )
        orderingOid = oid;
}

Here is the caller graph for this function:

void LDAPAttrType::setSingle ( int  at_single_value)

Definition at line 51 of file LDAPAttrType.cpp.

                                           {
    single = (at_single == 1);
}

Here is the caller graph for this function:

Definition at line 90 of file LDAPAttrType.cpp.

                                                   {
    if ( oid )
        substringOid = oid;
}

Here is the caller graph for this function:

Definition at line 75 of file LDAPAttrType.cpp.

                                                  {
    if ( oid )
        superiorOid = oid;
}

Here is the caller graph for this function:

Definition at line 95 of file LDAPAttrType.cpp.

                                                {
    if ( oid )
        syntaxOid = oid;
}

Here is the caller graph for this function:

Definition at line 71 of file LDAPAttrType.cpp.

                                         {
    usage = at_usage;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

std::string LDAPAttrType::desc [private]

Definition at line 23 of file LDAPAttrType.h.

std::string LDAPAttrType::equalityOid [private]

Definition at line 23 of file LDAPAttrType.h.

Definition at line 22 of file LDAPAttrType.h.

std::string LDAPAttrType::oid [private]

Definition at line 23 of file LDAPAttrType.h.

std::string LDAPAttrType::orderingOid [private]

Definition at line 24 of file LDAPAttrType.h.

bool LDAPAttrType::single [private]

Definition at line 25 of file LDAPAttrType.h.

std::string LDAPAttrType::substringOid [private]

Definition at line 24 of file LDAPAttrType.h.

std::string LDAPAttrType::superiorOid [private]

Definition at line 23 of file LDAPAttrType.h.

std::string LDAPAttrType::syntaxOid [private]

Definition at line 24 of file LDAPAttrType.h.

Definition at line 26 of file LDAPAttrType.h.


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