readDefFileText function

String readDefFileText(
  1. String filePath, {
  2. String baseFolderPath = '',
  3. String readTextFileFunction(
    1. String, [
    2. String
    ])? = readTextFile,
  4. bool hasImportCommands = true,
  5. String getImportedPathFunction(
    1. String
    )? = getImportedPath,
  6. List<String> getImportedFilePathArrayFunction(
    1. String
    )? = getImportedFilePathArray,
})

Implementation

String readDefFileText(
    String filePath,
    {
        String baseFolderPath = '',
        String Function( String, [String] )? readTextFileFunction = readTextFile,
        bool hasImportCommands = true,
        String Function( String )? getImportedPathFunction = getImportedPath,
        List<String> Function( String )? getImportedFilePathArrayFunction = getImportedFilePathArray
    }
    )
{
    var fileText = readTextFileFunction!( filePath, baseFolderPath ).trimRight();

    if ( hasImportCommands )
    {
        fileText =
            processDefFileText(
                fileText,
                baseFolderPath: baseFolderPath,
                filePath: filePath,
                readTextFileFunction: readTextFileFunction,
                hasImportCommands: hasImportCommands,
                getImportedPathFunction: getImportedPathFunction,
                getImportedFilePathArrayFunction: getImportedFilePathArrayFunction
                );
    }

    return fileText;
}