Class TOption
Unit
Declaration
type TOption = class(TObject)
Description
abstract 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.
Hierarchy
- TObject
- TOption
Overview
Fields
FShort: char; |
|
FLong: string; |
|
FShortSens: boolean; |
|
FLongSens: boolean; |
|
FExplanation: string; |
|
FWasSpecified: boolean; |
|
FParser: TOptionParser; |
Methods
function ParseOption(const AWords: TStrings): boolean; virtual; abstract; |
|
constructor Create(const AShort:char; const ALong: string); |
|
constructor CreateEx(const AShort:char; const ALong: string; const AShortCaseSensitive, ALongCaseSensitive: boolean); virtual; |
|
function GetOptionWidth: Integer; |
|
procedure WriteExplanation(const AOptWidth: Integer); |
Properties
property ShortForm: char read FShort write FShort; |
|
property LongForm: string read FLong write FLong; |
|
property ShortCaseSensitive: boolean read FShortSens write FShortSens; |
|
property LongCaseSensitive: boolean read FLongSens write FLongSens; |
|
property WasSpecified: boolean read FWasSpecified; |
|
property Explanation: string read FExplanation write FExplanation; |
Description
Fields
FShort: char; |
|
FLong: string; |
|
FShortSens: boolean; |
|
FLongSens: boolean; |
|
FExplanation: string; |
|
FWasSpecified: boolean; |
|
FParser: TOptionParser; |
|
Methods
function ParseOption(const AWords: TStrings): boolean; virtual; abstract; |
|
constructor CreateEx(const AShort:char; const ALong: string; const AShortCaseSensitive, ALongCaseSensitive: boolean); virtual; |
|
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) |
procedure WriteExplanation(const AOptWidth: Integer); |
|
writes the wrapped explanation including option format, AOptWidth determines how much it is indented & wrapped |
Properties
property ShortForm: char read FShort write FShort; |
|
Short form of the option — single character — if #0 then not used |
property LongForm: string read FLong write FLong; |
|
long form of the option — string — if empty, then not used |
property ShortCaseSensitive: boolean read FShortSens write FShortSens; |
|
specified whether the short form should be case sensitive or not |
property LongCaseSensitive: boolean read FLongSens write FLongSens; |
|
specifies whether the long form should be case sensitive or not |
property WasSpecified: boolean read FWasSpecified; |
|
signifies if the option was specified at least once |
property Explanation: string read FExplanation write FExplanation; |
|
explanation for the option, see also WriteExplanation |
Generated by PasDoc 0.16.0.