      1 /**
      2  *  ---------
      3  * |.##> <##.|  Open Smart Card Development Platform (www.openscdp.org)
      4  * |#       #|
      5  * |#       #|  Copyright (c) 1999-2018 CardContact Software & System Consulting
      6  * |'##> <##'|  Andreas Schwier, 32429 Minden, Germany (www.cardcontact.de)
      7  *  ---------
      8  *
      9  *  This file is part of OpenSCDP.
     10  *
     11  *  OpenSCDP is free software; you can redistribute it and/or modify
     12  *  it under the terms of the GNU General Public License version 2 as
     13  *  published by the Free Software Foundation.
     14  *
     15  *  OpenSCDP is distributed in the hope that it will be useful,
     16  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
     17  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     18  *  GNU General Public License for more details.
     19  *
     20  *  You should have received a copy of the GNU General Public License
     21  *  along with OpenSCDP; if not, write to the Free Software
     22  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
     23  *
     24  * @fileoverview Implementation of ISO 7816-4 APDU processing
     25  */
     26
     27
     28
     29 /**
     30  * Create a file system object identifiable by an id
     31  *
     32  * @class Abstract class for file system objects identified by an identifier
     33  *
     34  * @param {String} name the human readable name of the object
     35  * @param {Number} id the id
     36  */
     37 function FileSystemIdObject(name, id) {
     38 	this.name = name;
     39 	this.id = id;
     40 }
     41
     42 exports.FileSystemIdObject = FileSystemIdObject;
     43
     44
     45 /**
     46  * Return id of object
     47  */
     48 FileSystemIdObject.prototype.getId = function() {
     49 	return this.id;
     50 }
     51
     52
     53
     54 /**
     55  * Return type of object
     56  * @type string
     57  * @return type of object
     58  */
     59 FileSystemIdObject.prototype.getType = function() {
     60 	throw new GPError("FileSystemIdObject", GPError.NOT_IMPLEMENTED, 0, "Derived class must override getType()");
     61 }
     62
     63
     64
     65 /**
     66  * Return human readable string
     67  */
     68 FileSystemIdObject.prototype.toString = function() {
     69 	return this.name + "(" + this.id + ")";
     70 }
     71