new method Get of TLDAPAttributeList
git-svn-id: https://svn.code.sf.net/p/synalist/code/trunk@124 7c85be65-684b-0410-a082-b2ed4fbef004
This commit is contained in:
parent
15e4ca989a
commit
f7baff65b4
15
ldapsend.pas
15
ldapsend.pas
@ -1,5 +1,5 @@
|
|||||||
{==============================================================================|
|
{==============================================================================|
|
||||||
| Project : Ararat Synapse | 001.006.002 |
|
| Project : Ararat Synapse | 001.007.000 |
|
||||||
|==============================================================================|
|
|==============================================================================|
|
||||||
| Content: LDAP client |
|
| Content: LDAP client |
|
||||||
|==============================================================================|
|
|==============================================================================|
|
||||||
@ -129,6 +129,8 @@ type
|
|||||||
procedure Del(Index: integer);
|
procedure Del(Index: integer);
|
||||||
{:Find and return attribute with requested name. Returns nil if not found.}
|
{:Find and return attribute with requested name. Returns nil if not found.}
|
||||||
function Find(AttributeName: AnsiString): TLDAPAttribute;
|
function Find(AttributeName: AnsiString): TLDAPAttribute;
|
||||||
|
{:Find and return attribute value with requested name. Returns empty string if not found.}
|
||||||
|
function Get(AttributeName: AnsiString): string;
|
||||||
{:List of TLDAPAttribute objects.}
|
{:List of TLDAPAttribute objects.}
|
||||||
property Items[Index: Integer]: TLDAPAttribute read GetAttribute; default;
|
property Items[Index: Integer]: TLDAPAttribute read GetAttribute; default;
|
||||||
end;
|
end;
|
||||||
@ -396,6 +398,17 @@ begin
|
|||||||
Result := FAttributeList.Count;
|
Result := FAttributeList.Count;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TLDAPAttributeList.Get(AttributeName: AnsiString): string;
|
||||||
|
var
|
||||||
|
x: TLDAPAttribute;
|
||||||
|
begin
|
||||||
|
Result := '';
|
||||||
|
x := self.Find(AttributeName);
|
||||||
|
if x <> nil then
|
||||||
|
if x.Count > 0 then
|
||||||
|
Result := x[0];
|
||||||
|
end;
|
||||||
|
|
||||||
function TLDAPAttributeList.GetAttribute(Index: integer): TLDAPAttribute;
|
function TLDAPAttributeList.GetAttribute(Index: integer): TLDAPAttribute;
|
||||||
begin
|
begin
|
||||||
Result := nil;
|
Result := nil;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user