• Home
  • Raw
  • Download

Lines Matching full:this

36     this.byteWidth = 1 << (packedType & 3)
37 this.valueType = packedType >> 2
40 isNull(): boolean { return this.valueType === ValueType.NULL; }
41 isNumber(): boolean { return isNumber(this.valueType) || isIndirectNumber(this.valueType); }
42 …isFloat(): boolean { return ValueType.FLOAT === this.valueType || ValueType.INDIRECT_FLOAT === thi…
43 isInt(): boolean { return this.isNumber() && !this.isFloat(); }
44 …isString(): boolean { return ValueType.STRING === this.valueType || ValueType.KEY === this.valueTy…
45 isBool(): boolean { return ValueType.BOOL === this.valueType; }
46 isBlob(): boolean { return ValueType.BLOB === this.valueType; }
47 isVector(): boolean { return isAVector(this.valueType); }
48 isMap(): boolean { return ValueType.MAP === this.valueType; }
51 if (this.isBool()) {
52 return readInt(this.dataView, this.offset, this.parentWidth) > 0;
58 if (this.valueType === ValueType.INT) {
59 return readInt(this.dataView, this.offset, this.parentWidth);
61 if (this.valueType === ValueType.UINT) {
62 return readUInt(this.dataView, this.offset, this.parentWidth);
64 if (this.valueType === ValueType.INDIRECT_INT) {
65 …return readInt(this.dataView, indirect(this.dataView, this.offset, this.parentWidth), fromByteWidt…
67 if (this.valueType === ValueType.INDIRECT_UINT) {
68 …return readUInt(this.dataView, indirect(this.dataView, this.offset, this.parentWidth), fromByteWid…
74 if (this.valueType === ValueType.FLOAT) {
75 return readFloat(this.dataView, this.offset, this.parentWidth);
77 if (this.valueType === ValueType.INDIRECT_FLOAT) {
78 …return readFloat(this.dataView, indirect(this.dataView, this.offset, this.parentWidth), fromByteWi…
83 numericValue(): number | bigint | null { return this.floatValue() || this.intValue()}
86 if (this.valueType === ValueType.STRING || this.valueType === ValueType.KEY) {
87 const begin = indirect(this.dataView, this.offset, this.parentWidth);
88 return fromUTF8Array(new Uint8Array(this.dataView.buffer, begin, this.length()));
94 if (this.isBlob()) {
95 const begin = indirect(this.dataView, this.offset, this.parentWidth);
96 return new Uint8Array(this.dataView.buffer, begin, this.length());
102 const length = this.length();
103 if (Number.isInteger(key) && isAVector(this.valueType)) {
105 … throw `Key: [${key}] is not applicable on ${this.path} of ${this.valueType} length: ${length}`;
107 const _indirect = indirect(this.dataView, this.offset, this.parentWidth);
108 const elementOffset = _indirect + key * this.byteWidth;
109 let _packedType = this.dataView.getUint8(_indirect + length * this.byteWidth + key);
110 if (isTypedVector(this.valueType)) {
111 const _valueType = typedVectorElementType(this.valueType);
113 } else if (isFixedTypedVector(this.valueType)) {
114 const _valueType = fixedTypedVectorElementType(this.valueType);
117 …return new Reference(this.dataView, elementOffset, fromByteWidth(this.byteWidth), _packedType, `${
120 … const index = keyIndex(key, this.dataView, this.offset, this.parentWidth, this.byteWidth, length);
122 …eturn valueForIndexWithKey(index, key, this.dataView, this.offset, this.parentWidth, this.byteWidt…
125 throw `Key [${key}] is not applicable on ${this.path} of ${this.valueType}`;
130 if (this._length > -1) {
131 return this._length;
133 if (isFixedTypedVector(this.valueType)) {
134 this._length = fixedTypedVectorElementSize(this.valueType);
135 } else if (this.valueType === ValueType.BLOB
136 || this.valueType === ValueType.MAP
137 || isAVector(this.valueType)) {
138this._length = readUInt(this.dataView, indirect(this.dataView, this.offset, this.parentWidth) - th…
139 } else if (this.valueType === ValueType.NULL) {
140 this._length = 0;
141 } else if (this.valueType === ValueType.STRING) {
142 const _indirect = indirect(this.dataView, this.offset, this.parentWidth);
143 let sizeByteWidth = this.byteWidth;
144 size = readUInt(this.dataView, _indirect - sizeByteWidth, fromByteWidth(this.byteWidth));
145 while (this.dataView.getInt8(_indirect + (size as number)) !== 0) {
147 size = readUInt(this.dataView, _indirect - sizeByteWidth, fromByteWidth(this.byteWidth));
149 this._length = size as number;
150 } else if (this.valueType === ValueType.KEY) {
151 const _indirect = indirect(this.dataView, this.offset, this.parentWidth);
153 while (this.dataView.getInt8(_indirect + size) !== 0) {
156 this._length = size;
158 this._length = 1;
160 return Number(this._length);
164 const length = this.length();
165 if (this.isVector()) {
168 result.push(this.get(i).toObject());
172 if (this.isMap()) {
175 const key = keyForIndex(i, this.dataView, this.offset, this.parentWidth, this.byteWidth);
176 …lt[key] = valueForIndexWithKey(i, key, this.dataView, this.offset, this.parentWidth, this.byteWidt…
180 if (this.isNull()) {
183 if (this.isBool()) {
184 return this.boolValue();
186 if (this.isNumber()) {
187 return this.numericValue();
189 return this.blobValue() || this.stringValue();