Class TOption
Unit
Declaration
type TOption = class(TObject)
Description
Base class for options.
This class implements all the basic functionality and provides abstract methods for the TOptionParser class to call, which are overridden by descendants. It also provides function to write the explanation.
Source: source/component/PasDoc_OptionParser.pas (line 67).
Hierarchy
- TObject
- TOption
Overview
Fields
| Protected | FShort: char; |
| Protected | FLong: string; |
| Protected | FShortSens: boolean; |
| Protected | FLongSens: boolean; |
| Protected | FExplanation: string; |
| Protected | FWasSpecified: boolean; |
| Protected | FParser: TOptionParser; |
Methods
| Protected | function ParseOption(const AWords: TStrings): boolean; virtual; abstract; |
| Public | constructor Create(const AShort:char; const ALong: string); |
| Public | constructor CreateEx(const AShort:char; const ALong: string; const AShortCaseSensitive, ALongCaseSensitive: boolean); virtual; |
| Public | function GetOptionWidth: Integer; |
| Public | procedure WriteExplanation(const AOptWidth: Integer); |
Properties
| Public | property ShortForm: char read FShort write FShort; |
| Public | property LongForm: string read FLong write FLong; |
| Public | property ShortCaseSensitive: boolean read FShortSens write FShortSens; |
| Public | property LongCaseSensitive: boolean read FLongSens write FLongSens; |
| Public | property WasSpecified: boolean read FWasSpecified; |
| Public | property Explanation: string read FExplanation write FExplanation; |
Description
Fields
| Protected | FShort: char; |
|
This item has no description. | |
| Protected | FLong: string; |
|
This item has no description. | |
| Protected | FShortSens: boolean; |
|
This item has no description. | |
| Protected | FLongSens: boolean; |
|
This item has no description. | |
| Protected | FExplanation: string; |
|
This item has no description. | |
| Protected | FWasSpecified: boolean; |
|
This item has no description. | |
| Protected | FParser: TOptionParser; |
|
This item has no description. | |
Methods
| Protected | function ParseOption(const AWords: TStrings): boolean; virtual; abstract; |
|
This item has no description. | |
| Public | constructor Create(const AShort:char; const ALong: string); |
|
Create a new Option. Set AShort to #0 in order to have no short option. Technically you can set ALong to '' to have no long option, but in practive *every* option should have long form. Don't override this in descendants (this always simply calls CreateEx). Override only CreateEx. | |
| Public | constructor CreateEx(const AShort:char; const ALong: string; const AShortCaseSensitive, ALongCaseSensitive: boolean); virtual; |
|
This item has no description. | |
| Public | function GetOptionWidth: Integer; |
|
returns the width of the string "-s, --long-option" where s is the short option. Removes non-existant options (longoption = '' or shortoption = #0) | |
| Public | procedure WriteExplanation(const AOptWidth: Integer); |
|
writes the wrapped explanation including option format, AOptWidth determines how much it is indented & wrapped | |
Properties
| Public | property ShortForm: char read FShort write FShort; |
|
Short form of the option — single character — if #0 then not used Source: source/component/PasDoc_OptionParser.pas (line 100). | |
| Public | property LongForm: string read FLong write FLong; |
|
long form of the option — string — if empty, then not used Source: source/component/PasDoc_OptionParser.pas (line 102). | |
| Public | property ShortCaseSensitive: boolean read FShortSens write FShortSens; |
|
specified whether the short form should be case sensitive or not Source: source/component/PasDoc_OptionParser.pas (line 104). | |
| Public | property LongCaseSensitive: boolean read FLongSens write FLongSens; |
|
specifies whether the long form should be case sensitive or not Source: source/component/PasDoc_OptionParser.pas (line 106). | |
| Public | property WasSpecified: boolean read FWasSpecified; |
|
signifies if the option was specified at least once Source: source/component/PasDoc_OptionParser.pas (line 108). | |
| Public | property Explanation: string read FExplanation write FExplanation; |
|
explanation for the option, see also WriteExplanation Source: source/component/PasDoc_OptionParser.pas (line 110). | |
Generated by PasDoc 0.17.0.snapshot.