|
3 | 3 | * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
4 | 4 | * obtain one at https://mozilla.org/MPL/2.0/ |
5 | 5 | * |
6 | | - * Copyright (C) 2011-2021, Peter Johnson (gravatar.com/delphidabbler). |
| 6 | + * Copyright (C) 2011-2022, Peter Johnson (gravatar.com/delphidabbler). |
7 | 7 | * |
8 | 8 | * Objects, records etc that encapsulate a code snippet, its data and lists of |
9 | 9 | * code snippets. |
@@ -328,10 +328,17 @@ TSnippetList = class(TObject) |
328 | 328 | {Counts number of snippets in list. |
329 | 329 | @return Number of snippets in list. |
330 | 330 | } |
331 | | - function IsEmpty: Boolean; inline; |
| 331 | + function IsEmpty: Boolean; overload; inline; |
332 | 332 | {Checks if list is empty. |
333 | 333 | @return True if list is empty, False otehrwise. |
334 | 334 | } |
| 335 | + function IsEmpty(const UserDefined: Boolean): Boolean; overload; inline; |
| 336 | + {Checks if sub-set of list from either from or not from use defined |
| 337 | + database is empty. |
| 338 | + @param UserDefined [in] Flags whether to check for snippets in user |
| 339 | + database (True) or in main database (False). |
| 340 | + @return True if required subset is empty, False if not empty. |
| 341 | + } |
335 | 342 | property Items[Idx: Integer]: TSnippet read GetItem; default; |
336 | 343 | {List of snippets} |
337 | 344 | end; |
@@ -764,6 +771,11 @@ function TSnippetList.IsEmpty: Boolean; |
764 | 771 | Result := Count = 0; |
765 | 772 | end; |
766 | 773 |
|
| 774 | +function TSnippetList.IsEmpty(const UserDefined: Boolean): Boolean; |
| 775 | +begin |
| 776 | + Result := Count(UserDefined) = 0; |
| 777 | +end; |
| 778 | + |
767 | 779 | function TSnippetList.IsEqual(const AList: TSnippetList): Boolean; |
768 | 780 | {Checks if this list contains same snippets as another list. |
769 | 781 | @param AList [in] List of snippets to compare. |
|
0 commit comments