2
0
mirror of https://github.com/esiur/esiur-js.git synced 2025-06-27 15:23:11 +00:00

Annotations

This commit is contained in:
2022-06-16 04:51:43 +03:00
parent 89d8e5b627
commit fffce4d595
7 changed files with 101 additions and 54 deletions

View File

@ -3,24 +3,21 @@ import MemberTemplate from './MemberTemplate.js';
import Codec from '../../Data/Codec.js';
export default class ConstantTemplate extends MemberTemplate {
//final dynamic value;
//final String? expansion;
//final RepresentationType valueType;
constructor(template, index, name,
inherited, valueType, value, expansion){
inherited, valueType, value, annotation){
super(template, index, name, inherited) ;
this.valueType = valueType;
this.value = value;
this.expansion = expansion;
this.annotation = annotation;
}
compose() {
var name = super.compose();
var hdr = this.inherited ? 0x80 : 0;
if (this.expansion != null) {
var exp = DC.stringToBytes(this.expansion);
if (this.annotation != null) {
var exp = DC.stringToBytes(this.annotation);
hdr |= 0x70;
return (BL()
.addUint8(hdr)