Types - skalogryz/editorConfig GitHub Wiki
TTriBool = (
tbUnset,
tbFalse,
tbTrue
);
- tbUnset - unspecified (an editor default should be used)
- tbFalse - false (specified)
- tbTrue - true (specified)
TEditorConfigEntry = class(TObject)
public
indent_style : string;
indent_size : integer;
tab_width : integer;
end_of_line : string;
charset : string;
trim_trailing_whitespace : TTriBool;
insert_final_newline : TTriBool;
constructor Create(const aname: string);
property name: string read fname;
end;
- indent_style - set to tab or space to use hard tabs or soft tabs respectively.
- indent_size a whole number defining the number of columns used for each indentation level and the width of soft tabs (when supported). When set to tab, the value of tab_width (if specified) will be used.
- tab_width - a whole number defining the number of columns used to represent a tab character. This defaults to the value of indent_size and doesn't usually need to be specified.
- end_of_line - set to lf, cr, or crlf to control how line breaks are represented.
- charset - set to latin1, utf-8, utf-8-bom, utf-16be or utf-16le to control the character set.
- trim_trailing_whitespace - set to tbTrue to remove any whitespace characters preceding newline characters and tbFalse to ensure it doesn't.
- insert_final_newline - set to tbTrue to ensure file ends with a newline when saving and tbFalse to ensure it doesn't.
TEditorConfigFile = class(TObject)
public
root : Boolean;
filepath : String;
function AddEntry(const aname: string): TEditorConfigEntry;
property Entry[i: integer]: TEditorConfigEntry read GetEntry; default;
property Count: Integer read GetCount;
end;
- root - the boolean flag indicating if the file is .editorconfig root file
- filepath - optional file path of the .editorconfig stores. Can be empty.
- Count - number of entries in the file
- Entry - returns an editorconfig entry
- AddEntry() - creates a new entry for the pattern specified in aname parameter. The function doesn't check for duplicates.
function FileNameMatch(const pattern, filename: string): Boolean;
function ECMatch(const pattern, filename: string): Boolean;
function TryStrToTriBool(const S: string; out Value: TTriBool): Boolean;
If s is 0 or false the value is set to tbFalse, otherwise tbTrue.
The function always true.