Unit Utils.IO
Description
Unit which has a set of functions for manipulating files and their contents. It has some functions for content search as well.
Overview
Functions and Procedures
function GetFileContent(const AFileName: string): string; |
function GetJsonFileContentWithOutComments(const AFileName: string): string; |
procedure SaveFileContent(const AFileName, AContent: string); |
function FindInCodeFile(ACodeFile: TStringList; const AText: string): string; |
function FindFile(const ACurrentDir, AFileName: string): string; |
function FindProjectFile(const AProjectDir, AText: string): string; |
function FindSourceFile(const AProjectDir: string): string; |
Description
Functions and Procedures
function GetFileContent(const AFileName: string): string; |
Get the contents of AFileName in string.
File name that will have its content returned ) |
function GetJsonFileContentWithOutComments(const AFileName: string): string; |
Get the contents of a JSON AFileName in string. Remove commented lines to make possible do parse its content. Returns JSON content.
File name that will have its content returned ) |
procedure SaveFileContent(const AFileName, AContent: string); |
Save AContent string in the provided file name.
Parameters
|
function FindInCodeFile(ACodeFile: TStringList; const AText: string): string; |
Returns first ocurrence of text in format line:1 (column is always 1). It is case insensitive search. If not text is found the function returns an empty string.
Parameters
|
function FindFile(const ACurrentDir, AFileName: string): string; |
Recursively search for the first file from the specified path. Returns the filename with the full path if it was found.
Parameters
|
function FindProjectFile(const AProjectDir, AText: string): string; |
From the current directory it tries to locate a lazarus project that contains a specific text. If AText is empty the first project found will be returned. Returns the project file name.
Parameters
|
function FindSourceFile(const AProjectDir: string): string; |
From the current directory it tries to locate a source file. Any file with .pas or .pp extension will be considered as source file. Returns the first occurence of a source file. Returns empty if not source file was found.
Parameters
|
Generated by PasDoc 0.16.0.