Browse Source

* added GuidCase function to intf/guid helper functions

git-svn-id: trunk@13234 -
ivost 16 years ago
parent
commit
b5be9e008e
2 changed files with 10 additions and 0 deletions
  1. 1 0
      rtl/objpas/sysutils/intfh.inc
  2. 9 0
      rtl/objpas/sysutils/sysuintf.inc

+ 1 - 0
rtl/objpas/sysutils/intfh.inc

@@ -33,4 +33,5 @@ function Supports(const AClass: TClass; const IID: Shortstring): Boolean; overlo
 function StringToGUID(const S: string): TGUID;
 function GUIDToString(const GUID: TGUID): string;
 function IsEqualGUID(const guid1, guid2: TGUID): Boolean;
+function GuidCase(const GUID: TGUID; const List: array of TGuid): Integer;
 

+ 9 - 0
rtl/objpas/sysutils/sysuintf.inc

@@ -145,6 +145,15 @@ begin
 end;
 
 
+function GuidCase(const GUID: TGUID; const List: array of TGuid): Integer;
+begin
+  for Result := High(List) downto 0 do
+    if IsEqualGUID(GUID, List[Result]) then
+      Exit;
+  Result := -1;
+end;
+
+
 function GUIDToString(const GUID: TGUID): string;
 begin
   SetLength(Result, 38);