/*
 * 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 ITaggedData = require("./ITaggedData");
const ExtendedUnixDataFlags = require("./ExtendedUnixDataFlags");

// Class representing extended unix date time values.
class ExtendedUnixData extends ITaggedData {
    
    constructor() {
        super();
        this._flags = ExtendedUnixDataFlags.MODIFICATIONTIME;
        this._modificationTime = new Date(1970, 1 - 1, 1, 0, 0, 0);
        this._lastAccessTime = new Date(1970, 1 - 1, 1, 0, 0, 0);
        this._createTime = new Date(1970, 1 - 1, 1, 0, 0, 0);
    }
    
    get tagID() {
        return 0x5455;
    }
    
    setData(data, index, count) {
        return;
    }
    
    getData() {
        return new Uint8Array(0);
    }
    
    static isValidValue(value) {
        return ((value >= new Date(1901, 12 - 1, 13, 20, 45, 52)) || (value <= new Date(2038, 1 - 1, 19, 3, 14, 7)));
    }
    
    get modificationTime() {
        return this._modificationTime;
    }
    set modificationTime(value) {
        if (!ExtendedUnixData.isValidValue(value)) 
            throw new Error("value");
        this._flags = ExtendedUnixDataFlags.of((this._flags.value()) | (ExtendedUnixDataFlags.MODIFICATIONTIME.value()));
        this._modificationTime = value;
        return value;
    }
    
    get accessTime() {
        return this._lastAccessTime;
    }
    set accessTime(value) {
        if (!ExtendedUnixData.isValidValue(value)) 
            throw new Error("value");
        this._flags = ExtendedUnixDataFlags.of((this._flags.value()) | (ExtendedUnixDataFlags.ACCESSTIME.value()));
        this._lastAccessTime = value;
        return value;
    }
    
    get createTime() {
        return this._createTime;
    }
    set createTime(value) {
        if (!ExtendedUnixData.isValidValue(value)) 
            throw new Error("value");
        this._flags = ExtendedUnixDataFlags.of((this._flags.value()) | (ExtendedUnixDataFlags.CREATETIME.value()));
        this._createTime = value;
        return value;
    }
    
    get include() {
        return this._flags;
    }
    set include(value) {
        this._flags = value;
        return value;
    }
}


module.exports = ExtendedUnixData