/*
 * 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 Hashtable = require("./../../../unisharp/Hashtable");

// Defines the contents of the general bit flags field for an archive entry.
class GeneralBitFlags {

    constructor(val, str) {
        this.m_val = val;
        this.m_str = str;
    }
    toString() {
        return this.m_str;
    }
    value() {
        return this.m_val;
    }
    static of(val) {
        if(val instanceof GeneralBitFlags) 
            return val;
        if(typeof val === 'string' || val instanceof String) {
            val = val.toUpperCase();
            if(GeneralBitFlags.mapStringToEnum.containsKey(val))
                return GeneralBitFlags.mapStringToEnum.get(val);
            return null;
        }
        if(GeneralBitFlags.mapIntToEnum.containsKey(val))
            return GeneralBitFlags.mapIntToEnum.get(val);
        let it = new GeneralBitFlags(val, val.toString());
        GeneralBitFlags.mapIntToEnum.put(val, it);
        GeneralBitFlags.mapStringToEnum.put(val.toString(), it);
        return it;
    }
    static isDefined(val) {
        return GeneralBitFlags.m_Keys.indexOf(val) >= 0;
    }
    static getValues() {
        return GeneralBitFlags.m_Values;
    }
    static static_constructor() {
        GeneralBitFlags.mapIntToEnum = new Hashtable();
        GeneralBitFlags.mapStringToEnum = new Hashtable();
        GeneralBitFlags.ENCRYPTED = new GeneralBitFlags(0x0001, "ENCRYPTED");
        GeneralBitFlags.mapIntToEnum.put(GeneralBitFlags.ENCRYPTED.value(), GeneralBitFlags.ENCRYPTED); 
        GeneralBitFlags.mapStringToEnum.put(GeneralBitFlags.ENCRYPTED.m_str.toUpperCase(), GeneralBitFlags.ENCRYPTED); 
        GeneralBitFlags.METHOD = new GeneralBitFlags(0x0006, "METHOD");
        GeneralBitFlags.mapIntToEnum.put(GeneralBitFlags.METHOD.value(), GeneralBitFlags.METHOD); 
        GeneralBitFlags.mapStringToEnum.put(GeneralBitFlags.METHOD.m_str.toUpperCase(), GeneralBitFlags.METHOD); 
        GeneralBitFlags.DESCRIPTOR = new GeneralBitFlags(0x0008, "DESCRIPTOR");
        GeneralBitFlags.mapIntToEnum.put(GeneralBitFlags.DESCRIPTOR.value(), GeneralBitFlags.DESCRIPTOR); 
        GeneralBitFlags.mapStringToEnum.put(GeneralBitFlags.DESCRIPTOR.m_str.toUpperCase(), GeneralBitFlags.DESCRIPTOR); 
        GeneralBitFlags.RESERVEDPKWARE4 = new GeneralBitFlags(0x0010, "RESERVEDPKWARE4");
        GeneralBitFlags.mapIntToEnum.put(GeneralBitFlags.RESERVEDPKWARE4.value(), GeneralBitFlags.RESERVEDPKWARE4); 
        GeneralBitFlags.mapStringToEnum.put(GeneralBitFlags.RESERVEDPKWARE4.m_str.toUpperCase(), GeneralBitFlags.RESERVEDPKWARE4); 
        GeneralBitFlags.PATCHED = new GeneralBitFlags(0x0020, "PATCHED");
        GeneralBitFlags.mapIntToEnum.put(GeneralBitFlags.PATCHED.value(), GeneralBitFlags.PATCHED); 
        GeneralBitFlags.mapStringToEnum.put(GeneralBitFlags.PATCHED.m_str.toUpperCase(), GeneralBitFlags.PATCHED); 
        GeneralBitFlags.STRONGENCRYPTION = new GeneralBitFlags(0x0040, "STRONGENCRYPTION");
        GeneralBitFlags.mapIntToEnum.put(GeneralBitFlags.STRONGENCRYPTION.value(), GeneralBitFlags.STRONGENCRYPTION); 
        GeneralBitFlags.mapStringToEnum.put(GeneralBitFlags.STRONGENCRYPTION.m_str.toUpperCase(), GeneralBitFlags.STRONGENCRYPTION); 
        GeneralBitFlags.UNUSED7 = new GeneralBitFlags(0x0080, "UNUSED7");
        GeneralBitFlags.mapIntToEnum.put(GeneralBitFlags.UNUSED7.value(), GeneralBitFlags.UNUSED7); 
        GeneralBitFlags.mapStringToEnum.put(GeneralBitFlags.UNUSED7.m_str.toUpperCase(), GeneralBitFlags.UNUSED7); 
        GeneralBitFlags.UNUSED8 = new GeneralBitFlags(0x0100, "UNUSED8");
        GeneralBitFlags.mapIntToEnum.put(GeneralBitFlags.UNUSED8.value(), GeneralBitFlags.UNUSED8); 
        GeneralBitFlags.mapStringToEnum.put(GeneralBitFlags.UNUSED8.m_str.toUpperCase(), GeneralBitFlags.UNUSED8); 
        GeneralBitFlags.UNUSED9 = new GeneralBitFlags(0x0200, "UNUSED9");
        GeneralBitFlags.mapIntToEnum.put(GeneralBitFlags.UNUSED9.value(), GeneralBitFlags.UNUSED9); 
        GeneralBitFlags.mapStringToEnum.put(GeneralBitFlags.UNUSED9.m_str.toUpperCase(), GeneralBitFlags.UNUSED9); 
        GeneralBitFlags.UNUSED10 = new GeneralBitFlags(0x0400, "UNUSED10");
        GeneralBitFlags.mapIntToEnum.put(GeneralBitFlags.UNUSED10.value(), GeneralBitFlags.UNUSED10); 
        GeneralBitFlags.mapStringToEnum.put(GeneralBitFlags.UNUSED10.m_str.toUpperCase(), GeneralBitFlags.UNUSED10); 
        GeneralBitFlags.UNICODETEXT = new GeneralBitFlags(0x0800, "UNICODETEXT");
        GeneralBitFlags.mapIntToEnum.put(GeneralBitFlags.UNICODETEXT.value(), GeneralBitFlags.UNICODETEXT); 
        GeneralBitFlags.mapStringToEnum.put(GeneralBitFlags.UNICODETEXT.m_str.toUpperCase(), GeneralBitFlags.UNICODETEXT); 
        GeneralBitFlags.ENHANCEDCOMPRESS = new GeneralBitFlags(0x1000, "ENHANCEDCOMPRESS");
        GeneralBitFlags.mapIntToEnum.put(GeneralBitFlags.ENHANCEDCOMPRESS.value(), GeneralBitFlags.ENHANCEDCOMPRESS); 
        GeneralBitFlags.mapStringToEnum.put(GeneralBitFlags.ENHANCEDCOMPRESS.m_str.toUpperCase(), GeneralBitFlags.ENHANCEDCOMPRESS); 
        GeneralBitFlags.HEADERMASKED = new GeneralBitFlags(0x2000, "HEADERMASKED");
        GeneralBitFlags.mapIntToEnum.put(GeneralBitFlags.HEADERMASKED.value(), GeneralBitFlags.HEADERMASKED); 
        GeneralBitFlags.mapStringToEnum.put(GeneralBitFlags.HEADERMASKED.m_str.toUpperCase(), GeneralBitFlags.HEADERMASKED); 
        GeneralBitFlags.RESERVEDPKWARE14 = new GeneralBitFlags(0x4000, "RESERVEDPKWARE14");
        GeneralBitFlags.mapIntToEnum.put(GeneralBitFlags.RESERVEDPKWARE14.value(), GeneralBitFlags.RESERVEDPKWARE14); 
        GeneralBitFlags.mapStringToEnum.put(GeneralBitFlags.RESERVEDPKWARE14.m_str.toUpperCase(), GeneralBitFlags.RESERVEDPKWARE14); 
        GeneralBitFlags.RESERVEDPKWARE15 = new GeneralBitFlags(0x8000, "RESERVEDPKWARE15");
        GeneralBitFlags.mapIntToEnum.put(GeneralBitFlags.RESERVEDPKWARE15.value(), GeneralBitFlags.RESERVEDPKWARE15); 
        GeneralBitFlags.mapStringToEnum.put(GeneralBitFlags.RESERVEDPKWARE15.m_str.toUpperCase(), GeneralBitFlags.RESERVEDPKWARE15); 
        GeneralBitFlags.m_Values = Array.from(GeneralBitFlags.mapIntToEnum.values);
        GeneralBitFlags.m_Keys = Array.from(GeneralBitFlags.mapIntToEnum.keys);
    }
}


GeneralBitFlags.static_constructor();

module.exports = GeneralBitFlags