Added TLDAPAttributeList.Find
git-svn-id: https://svn.code.sf.net/p/synalist/code/trunk@85 7c85be65-684b-0410-a082-b2ed4fbef004
This commit is contained in:
parent
f61e0889c2
commit
50d051d2dc
25
ldapsend.pas
25
ldapsend.pas
@ -1,9 +1,9 @@
|
||||
{==============================================================================|
|
||||
| Project : Ararat Synapse | 001.004.001 |
|
||||
| Project : Ararat Synapse | 001.005.000 |
|
||||
|==============================================================================|
|
||||
| Content: LDAP client |
|
||||
|==============================================================================|
|
||||
| Copyright (c)1999-2005, Lukas Gebauer |
|
||||
| Copyright (c)1999-2008, Lukas Gebauer |
|
||||
| All rights reserved. |
|
||||
| |
|
||||
| Redistribution and use in source and binary forms, with or without |
|
||||
@ -122,6 +122,8 @@ type
|
||||
function Add: TLDAPAttribute;
|
||||
{:Delete one TLDAPAttribute object from list.}
|
||||
procedure Del(Index: integer);
|
||||
{:Find and return attribute with requested name. Returns nil if not found.}
|
||||
function Find(AttributeName: string): TLDAPAttribute;
|
||||
{:List of TLDAPAttribute objects.}
|
||||
property Items[Index: Integer]: TLDAPAttribute read GetAttribute; default;
|
||||
end;
|
||||
@ -412,6 +414,25 @@ begin
|
||||
FAttributeList.Delete(Index);
|
||||
end;
|
||||
|
||||
function TLDAPAttributeList.Find(AttributeName: string): TLDAPAttribute;
|
||||
var
|
||||
n: integer;
|
||||
x: TLDAPAttribute;
|
||||
begin
|
||||
Result := nil;
|
||||
AttributeName := lowercase(AttributeName);
|
||||
for n := 0 to Count - 1 do
|
||||
begin
|
||||
x := GetAttribute(n);
|
||||
if Assigned(x) then
|
||||
if lowercase(x.AttributeName) = Attributename then
|
||||
begin
|
||||
result := x;
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
{==============================================================================}
|
||||
constructor TLDAPResult.Create;
|
||||
begin
|
||||
|
Loading…
x
Reference in New Issue
Block a user