Class TPasCio

Unit

Declaration

type TPasCio = class(TPasType)

Description

Extends TPasItem to store all items in a class / an object, e.g. fields.

Hierarchy

Overview

Fields

Protected FClassDirective: TClassDirective;
Protected FFields: TPasItems;
Protected FMethods: TPasMethods;
Protected FProperties: TPasProperties;
Protected FAncestors: TStringPairVector;
Protected FOutputFileName: string;
Protected FMyType: TCIOType;
Protected FHelperTypeIdentifier: string;
Protected FCios: TPasNestedCios;
Protected FTypes: TPasTypes;
Protected FNameWithGeneric: string;

Methods

Protected procedure Serialize(const ADestination: TStream); override;
Protected procedure Deserialize(const ASource: TStream); override;
Protected procedure StoreMemberTag(ThisTag: TTag; var ThisTagData: TObject; EnclosingTag: TTag; var EnclosingTagData: TObject; const TagParameter: string; var ReplaceStr: string);
Public constructor Create; override;
Public destructor Destroy; override;
Public function FindItem(const ItemName: string): TBaseItem; override;
Public function FindItemMaybeInAncestors(const ItemName: string): TBaseItem; override;
Public function FindItemInAncestors(const ItemName: string): TPasItem;
Public procedure Sort(const SortSettings: TSortSettings); override;
Public procedure RegisterTags(TagManager: TTagManager); override;
Public function FirstAncestor: TPasItem;
Public function FirstAncestorName: string;
Public function ShowVisibility: boolean;

Properties

Public property Ancestors: TStringPairVector read FAncestors;
Public property Cios: TPasNestedCios read FCios;
Public property ClassDirective: TClassDirective read FClassDirective write FClassDirective;
Public property Fields: TPasItems read FFields;
Public property HelperTypeIdentifier: string read FHelperTypeIdentifier write FHelperTypeIdentifier;
Public property Methods: TPasMethods read FMethods;
Public property Properties: TPasProperties read FProperties;
Public property MyType: TCIOType read FMyType write FMyType;
Public property OutputFileName: string read FOutputFileName write FOutputFileName;
Public property Types: TPasTypes read FTypes;
Public property NameWithGeneric: string read FNameWithGeneric write FNameWithGeneric;

Description

Fields

Protected FClassDirective: TClassDirective;
 
Protected FFields: TPasItems;
 
Protected FMethods: TPasMethods;
 
Protected FProperties: TPasProperties;
 
Protected FAncestors: TStringPairVector;
 
Protected FOutputFileName: string;
 
Protected FMyType: TCIOType;
 
Protected FHelperTypeIdentifier: string;
 
Protected FCios: TPasNestedCios;
 
Protected FTypes: TPasTypes;
 
Protected FNameWithGeneric: string;
 

Methods

Protected procedure Serialize(const ADestination: TStream); override;
 
Protected procedure Deserialize(const ASource: TStream); override;
 
Protected procedure StoreMemberTag(ThisTag: TTag; var ThisTagData: TObject; EnclosingTag: TTag; var EnclosingTagData: TObject; const TagParameter: string; var ReplaceStr: string);
 
Public constructor Create; override;
 
Public destructor Destroy; override;
 
Public function FindItem(const ItemName: string): TBaseItem; override;

If this class (or interface or object) contains a field, method or property with the name of ItemName, the corresponding item pointer is returned.

Public function FindItemMaybeInAncestors(const ItemName: string): TBaseItem; override;
 
Public function FindItemInAncestors(const ItemName: string): TPasItem;

This searches for item (field, method or property) defined in ancestor of this cio. I.e. searches within the FirstAncestor, then within FirstAncestor.FirstAncestor, and so on. Returns nil if not found.

Public procedure Sort(const SortSettings: TSortSettings); override;
 
Public procedure RegisterTags(TagManager: TTagManager); override;
 
Public function FirstAncestor: TPasItem;

This returns Ancestors[0].Data, i.e. instance of the first ancestor of this Cio (or nil if it couldn't be found), or nil if Ancestors.Count = 0.

Public function FirstAncestorName: string;

This returns the name of first ancestor of this Cio.

If Ancestor.Count > 0 then it simply returns Ancestors[0], i.e. the name of the first ancestor as was specified at class declaration, else it returns ''.

So this method is roughly something like FirstAncestor.Name, but with a few notable differences:

  • FirstAncestor is nil if the ancestor was not found in items parsed by pasdoc. But this method will still return in this case name of ancestor.

  • FirstAncestor.Name is the name of ancestor as specified at declaration of an ancestor. But this method is the name of ancestor as specified at declaration of this cio — with the same letter case, with optional unit specifier.

If this function returns '', then you can be sure that FirstAncestor returns nil. The other way around is not necessarily true — FirstAncestor may be nil, but still this function may return something <> ''.

Public function ShowVisibility: boolean;

Is Visibility of items (Fields, Methods, Properties) important ?

Properties

Public property Ancestors: TStringPairVector read FAncestors;

Name of the ancestor (class, object, interface). Each item is a TStringPair, with

  • Name is the name (single Pascal identifier) of this ancestor,

  • Value is the full declaration of this ancestor. For example, in addition to Name, this may include "specialize" directive (for FPC generic specialization) at the beginning. And "<foo,bar>" section at the end (for FPC or Delphi generic specialization).

  • Data is a TPasItem reference to this ancestor, or Nil if not found. This is assigned only in TDocGenerator.BuildLinks.

Note that each ancestor is a TPasItem, not necessarily TPasCio. Consider e.g. the case

TMyStringList = Classes.TStringList;
TMyExtendedStringList = class(TMyStringList)
  ...
end;

At least for now, such declaration will result in TPasType (not TPasCio!) with Name = 'TMyStringList', which means that ancestor of TMyExtendedStringList will be a TPasType instance.

Note that the PasDoc_Parser already takes care of correctly setting Ancestors when user didn't specify any ancestor name at cio declaration. E.g. if this cio is a class, and user didn't specify ancestor name at class declaration, and this class name is not 'TObject' (in case pasdoc parses the RTL), the Ancestors[0] will be set to 'TObject'.

Public property Cios: TPasNestedCios read FCios;

Nested classes (and records, interfaces...).

Public property ClassDirective: TClassDirective read FClassDirective write FClassDirective;

ClassDirective is used to indicate whether a class is sealed or abstract.

Public property Fields: TPasItems read FFields;

list of all fields

Public property HelperTypeIdentifier: string read FHelperTypeIdentifier write FHelperTypeIdentifier;

Class or record helper type identifier

Public property Methods: TPasMethods read FMethods;

list of all methods

Public property Properties: TPasProperties read FProperties;

list of properties

Public property MyType: TCIOType read FMyType write FMyType;

determines if this is a class, an interface or an object

Public property OutputFileName: string read FOutputFileName write FOutputFileName;

name of documentation output file (if each class / object gets its own file, that's the case for HTML, but not for TeX)

Public property Types: TPasTypes read FTypes;

Simple nested types (that don't fall into Cios).

Public property NameWithGeneric: string read FNameWithGeneric write FNameWithGeneric;

Name, with optional "generic" directive before (for FPC generics) and generic type identifiers list "<foo,bar>" after (for FPC and Delphi generics).


Generated by PasDoc 0.15.0.