/*
 * SDK Pullenti Unitext, version 4.33, fabruary 2026. Copyright (c) 2013-2026, Pullenti. All rights reserved. 
 * Non-Commercial Freeware and Commercial Software. 
 * This class is generated using the converter UniSharping (www.unisharping.ru) from Pullenti C# project. 
 * The latest version of the code is available on the site www.pullenti.ru
 */

const fs = require('fs');
const Stream = require("./../../../unisharp/Stream");
const FileStream = require("./../../../unisharp/FileStream");

const IStaticDataSource = require("./IStaticDataSource");

/**
 * Default implementation of a <see cref="IStaticDataSource"/> for use with files stored on disk.
 */
class StaticDiskDataSource extends IStaticDataSource {
    
    /**
     * Initialise a new instnace of <see cref="StaticDiskDataSource"/>
     * @param fileName The name of the file to obtain data from.
     */
    constructor(fileName) {
        super();
        this.fileName_ = null;
        this.fileName_ = fileName;
    }
    
    /**
     * Get a <see cref="Stream"/> providing data.
     * @return Returns a <see cref="Stream"/> provising data.
     */
    getSource() {
        return new FileStream(this.fileName_, "r", false);
    }
}


module.exports = StaticDiskDataSource