Class TPasItems

Unit

Declaration

type TPasItems = class(TBaseItems)

Description

Container class to store a list of TPasItems.

Source: source/component/PasDoc_Items.pas (line 1191).

Hierarchy

Show Additional Members:

Overview

Methods

Protected procedure Serialize(const ADestination: TStream); virtual;
Protected procedure Deserialize(const ASource: TStream); virtual;
Public constructor Create(const AOwnsObject: Boolean); reintroduce; virtual;
Public destructor Destroy; override;
Public function FindListItem(const ASignature: string): TBaseItem;
Public procedure InsertItems(const c: TBaseItems);
Public procedure Add(const AObject: TBaseItem); reintroduce; virtual;
Public procedure ClearAndAdd(const AObject: TBaseItem);
Public procedure Delete(const AIndex: Integer);
Public procedure Clear; reintroduce; virtual;
Public function FindListItem(const ASignature: string): TPasItem;
Public procedure CopyItems(const c: TPasItems);
Public procedure CountCIO(var c, i, o: Integer);
Public procedure RemovePrivateItems;
Public procedure SortDeep(const SortSettings: TSortSettings);
Public procedure SortOnlyInsideItems(const SortSettings: TSortSettings);
Public procedure SortShallow(const Unqualified: Boolean = false);
Public procedure SetFullDeclaration(PrefixName: boolean; const Suffix: string);

Properties

Public property PasItemAt[const AIndex: Integer]: TPasItem read GetPasItemAt write SetPasItemAt;

Description

Methods

Protected procedure Serialize(const ADestination: TStream); virtual;

This item has no description.

Source: source/component/PasDoc_Items.pas (line 1154).

Protected procedure Deserialize(const ASource: TStream); virtual;

This item has no description.

Source: source/component/PasDoc_Items.pas (line 1155).

Public constructor Create(const AOwnsObject: Boolean); reintroduce; virtual;

This item has no description.

Source: source/component/PasDoc_Items.pas (line 1157).

Public destructor Destroy; override;

This item has no description.

Source: source/component/PasDoc_Items.pas (line 1158).

Public function FindListItem(const ASignature: string): TBaseItem;

Find a given item name on a list. In the base class (TBaseItems), this simply searches the items (not recursively).

In some cases, it may look within the items (recursively), when the identifiers inside the item are in same namespace as the items themselves. Example: it will look also inside enumerated types members, because (when "scoped enums" are off) the enumerated members are in the same namespace as the enumerated type name.

Returns Nil if nothing can be found.

Source: source/component/PasDoc_Items.pas (line 1171).

Public procedure InsertItems(const c: TBaseItems);

Inserts all items of C into this collection. Disposes C and sets it to nil.

Source: source/component/PasDoc_Items.pas (line 1175).

Public procedure Add(const AObject: TBaseItem); reintroduce; virtual;

During Add, AObject is associated with AObject.Name using hash table, so remember to set AObject.Name before calling Add(AObject).

Source: source/component/PasDoc_Items.pas (line 1179).

Public procedure ClearAndAdd(const AObject: TBaseItem);

This is a shortcut for doing Clear and then Add(AObject). Useful when you want the list to contain exactly the one given AObject.

Source: source/component/PasDoc_Items.pas (line 1184).

Public procedure Delete(const AIndex: Integer);

This item has no description.

Source: source/component/PasDoc_Items.pas (line 1186).

Public procedure Clear; reintroduce; virtual;

This item has no description.

Source: source/component/PasDoc_Items.pas (line 1187).

Public function FindListItem(const ASignature: string): TPasItem;

A comfortable routine that just calls inherited and casts result to TPasItem, since every item on this list must be always TPasItem.

Source: source/component/PasDoc_Items.pas (line 1199).

Public procedure CopyItems(const c: TPasItems);

Copies all Items from c to this object, not changing c at all.

Source: source/component/PasDoc_Items.pas (line 1202).

Public procedure CountCIO(var c, i, o: Integer);

Counts classes, interfaces and objects within this collection.

Source: source/component/PasDoc_Items.pas (line 1205).

Public procedure RemovePrivateItems;

Checks each element's Visibility field and removes all elements with a value of viPrivate.

Source: source/component/PasDoc_Items.pas (line 1209).

Public procedure SortDeep(const SortSettings: TSortSettings);

Sort all items by their (qualified) name, and call Sort(SortSettings) for each of these items. This way we sort recursively everything in this list.

This is equivalent to doing both SortShallow and SortOnlyInsideItems.

Source: source/component/PasDoc_Items.pas (line 1221).

Public procedure SortOnlyInsideItems(const SortSettings: TSortSettings);

Call Sort(SortSettings) for each of items on the list. It does not sort the items on this list.

Source: source/component/PasDoc_Items.pas (line 1226).

Public procedure SortShallow(const Unqualified: Boolean = false);

Sort all items on this list by their name, qualified or not. Unlike SortDeep, it does not call Sort for each of these items. So "items inside items" (e.g. class methods, if this list contains TPasCio objects) remain unsorted.

Parameters
Unqualified

When True, we sort first by TBaseItem.Name.

When False, we sort first by TPasItem.UnitRelativeQualifiedName, which includes unit and class names.

Source: source/component/PasDoc_Items.pas (line 1241).

Public procedure SetFullDeclaration(PrefixName: boolean; const Suffix: string);

Sets FullDeclaration of every item to

  1. Name of this item (only if PrefixName)

  2. + Suffix.

Very useful if you have a couple of items that share a common declaration in source file, e.g. variables or fields declared like

A, B: Integer;

Source: source/component/PasDoc_Items.pas (line 1253).

Properties

Public property PasItemAt[const AIndex: Integer]: TPasItem read GetPasItemAt write SetPasItemAt;

This item has no description.

Source: source/component/PasDoc_Items.pas (line 1211).


Generated by PasDoc 0.17.0.snapshot.