@dusted/anqst 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/app.js +31 -9
- package/dist/src/base93.js +0 -72
- package/dist/src/boundary-codec-analysis.js +468 -0
- package/dist/src/boundary-codec-leaves.js +602 -0
- package/dist/src/boundary-codec-model.js +77 -0
- package/dist/src/boundary-codec-plan.js +522 -0
- package/dist/src/boundary-codec-render.js +1738 -0
- package/dist/src/boundary-codecs.js +174 -0
- package/dist/src/emit.js +580 -90
- package/dist/src/program.js +1 -1
- package/package.json +2 -2
- package/dist/src/codecgenerators/basecodecemitters/bigint-qint64/decoder.js +0 -35
- package/dist/src/codecgenerators/basecodecemitters/bigint-qint64/encoder.js +0 -36
- package/dist/src/codecgenerators/basecodecemitters/bigint-quint64/decoder.js +0 -26
- package/dist/src/codecgenerators/basecodecemitters/bigint-quint64/encoder.js +0 -38
- package/dist/src/codecgenerators/basecodecemitters/binary-blob/decoder.js +0 -28
- package/dist/src/codecgenerators/basecodecemitters/binary-blob/encoder.js +0 -34
- package/dist/src/codecgenerators/basecodecemitters/binary-buffer/decoder.js +0 -29
- package/dist/src/codecgenerators/basecodecemitters/binary-buffer/encoder.js +0 -36
- package/dist/src/codecgenerators/basecodecemitters/binary-float32Array/decoder.js +0 -46
- package/dist/src/codecgenerators/basecodecemitters/binary-float32Array/encoder.js +0 -49
- package/dist/src/codecgenerators/basecodecemitters/binary-float64Array/decoder.js +0 -46
- package/dist/src/codecgenerators/basecodecemitters/binary-float64Array/encoder.js +0 -47
- package/dist/src/codecgenerators/basecodecemitters/binary-int16Array/decoder.js +0 -46
- package/dist/src/codecgenerators/basecodecemitters/binary-int16Array/encoder.js +0 -49
- package/dist/src/codecgenerators/basecodecemitters/binary-int32Array/decoder.js +0 -50
- package/dist/src/codecgenerators/basecodecemitters/binary-int32Array/encoder.js +0 -52
- package/dist/src/codecgenerators/basecodecemitters/binary-int8Array/decoder.js +0 -38
- package/dist/src/codecgenerators/basecodecemitters/binary-int8Array/encoder.js +0 -44
- package/dist/src/codecgenerators/basecodecemitters/binary-typedArray/decoder.js +0 -33
- package/dist/src/codecgenerators/basecodecemitters/binary-typedArray/encoder.js +0 -34
- package/dist/src/codecgenerators/basecodecemitters/binary-uint16Array/decoder.js +0 -46
- package/dist/src/codecgenerators/basecodecemitters/binary-uint16Array/encoder.js +0 -49
- package/dist/src/codecgenerators/basecodecemitters/binary-uint32Array/decoder.js +0 -46
- package/dist/src/codecgenerators/basecodecemitters/binary-uint32Array/encoder.js +0 -49
- package/dist/src/codecgenerators/basecodecemitters/binary-uint8Array/decoder.js +0 -28
- package/dist/src/codecgenerators/basecodecemitters/binary-uint8Array/encoder.js +0 -34
- package/dist/src/codecgenerators/basecodecemitters/boolean/decoder.js +0 -34
- package/dist/src/codecgenerators/basecodecemitters/boolean/encoder.js +0 -40
- package/dist/src/codecgenerators/basecodecemitters/dynamic-json/decoder.js +0 -43
- package/dist/src/codecgenerators/basecodecemitters/dynamic-json/encoder.js +0 -45
- package/dist/src/codecgenerators/basecodecemitters/dynamic-object/decoder.js +0 -44
- package/dist/src/codecgenerators/basecodecemitters/dynamic-object/encoder.js +0 -46
- package/dist/src/codecgenerators/basecodecemitters/integer-int16/decoder.js +0 -32
- package/dist/src/codecgenerators/basecodecemitters/integer-int16/encoder.js +0 -43
- package/dist/src/codecgenerators/basecodecemitters/integer-int32/decoder.js +0 -26
- package/dist/src/codecgenerators/basecodecemitters/integer-int32/encoder.js +0 -37
- package/dist/src/codecgenerators/basecodecemitters/integer-int8/decoder.js +0 -26
- package/dist/src/codecgenerators/basecodecemitters/integer-int8/encoder.js +0 -37
- package/dist/src/codecgenerators/basecodecemitters/integer-qint16/decoder.js +0 -36
- package/dist/src/codecgenerators/basecodecemitters/integer-qint16/encoder.js +0 -36
- package/dist/src/codecgenerators/basecodecemitters/integer-qint32/decoder.js +0 -25
- package/dist/src/codecgenerators/basecodecemitters/integer-qint32/encoder.js +0 -36
- package/dist/src/codecgenerators/basecodecemitters/integer-qint8/decoder.js +0 -36
- package/dist/src/codecgenerators/basecodecemitters/integer-qint8/encoder.js +0 -36
- package/dist/src/codecgenerators/basecodecemitters/integer-quint16/decoder.js +0 -26
- package/dist/src/codecgenerators/basecodecemitters/integer-quint16/encoder.js +0 -38
- package/dist/src/codecgenerators/basecodecemitters/integer-quint32/decoder.js +0 -27
- package/dist/src/codecgenerators/basecodecemitters/integer-quint32/encoder.js +0 -39
- package/dist/src/codecgenerators/basecodecemitters/integer-quint8/decoder.js +0 -26
- package/dist/src/codecgenerators/basecodecemitters/integer-quint8/encoder.js +0 -38
- package/dist/src/codecgenerators/basecodecemitters/integer-uint16/decoder.js +0 -30
- package/dist/src/codecgenerators/basecodecemitters/integer-uint16/encoder.js +0 -42
- package/dist/src/codecgenerators/basecodecemitters/integer-uint32/decoder.js +0 -31
- package/dist/src/codecgenerators/basecodecemitters/integer-uint32/encoder.js +0 -43
- package/dist/src/codecgenerators/basecodecemitters/integer-uint8/decoder.js +0 -30
- package/dist/src/codecgenerators/basecodecemitters/integer-uint8/encoder.js +0 -40
- package/dist/src/codecgenerators/basecodecemitters/number/decoder.js +0 -26
- package/dist/src/codecgenerators/basecodecemitters/number/encoder.js +0 -38
- package/dist/src/codecgenerators/basecodecemitters/shared/comments.js +0 -13
- package/dist/src/codecgenerators/basecodecemitters/shared/contracts.js +0 -2
- package/dist/src/codecgenerators/basecodecemitters/shared/fixedwidth.js +0 -53
- package/dist/src/codecgenerators/basecodecemitters/shared/index.js +0 -21
- package/dist/src/codecgenerators/basecodecemitters/shared/positionalBase93.js +0 -48
- package/dist/src/codecgenerators/basecodecemitters/shared/rawbytes.js +0 -30
- package/dist/src/codecgenerators/basecodecemitters/string/decoder.js +0 -43
- package/dist/src/codecgenerators/basecodecemitters/string/encoder.js +0 -43
- package/dist/src/codecgenerators/basecodecemitters/stringArray/decoder.js +0 -80
- package/dist/src/codecgenerators/basecodecemitters/stringArray/encoder.js +0 -57
- package/dist/src/structured-top-level-codecs.js +0 -1305
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* AnQst base-type codec emitter: AnQst.Type.object (dynamic object).
|
|
4
|
-
*
|
|
5
|
-
* Wire: parsed JSON Object is the domain value — identity decode. Same scope rules as the
|
|
6
|
-
* encoder: only for explicitly declared dynamic object types in the spec, never as a generic
|
|
7
|
-
* fallback for unknown static shapes.
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.decoder = exports.descriptor = void 0;
|
|
11
|
-
const comments_1 = require("../shared/comments");
|
|
12
|
-
exports.descriptor = {
|
|
13
|
-
codecId: "AnQst.Type.object",
|
|
14
|
-
specPath: "RefinedSpecs/Codecs/Dynamic_object_Codec.md",
|
|
15
|
-
tsType: "object",
|
|
16
|
-
cppType: "QVariantMap",
|
|
17
|
-
wireCategory: "dynamic",
|
|
18
|
-
strategySummary: "Pass-through JSON Object on the wire for explicitly dynamic AnQst.Type.object only; no base93, no flattening."
|
|
19
|
-
};
|
|
20
|
-
function emitTsDecoderSource(functionName = "decodeDynamicObject") {
|
|
21
|
-
const comment = (0, comments_1.emitStrategyComment)("AnQst.Type.object — TypeScript decode (identity)", [
|
|
22
|
-
"The JSON Object already parsed from the wire is the domain value; no per-field transform.",
|
|
23
|
-
"Applies only where the spec names AnQst.Type.object as the field or root type."
|
|
24
|
-
]);
|
|
25
|
-
return `${comment}
|
|
26
|
-
function ${functionName}(value) {
|
|
27
|
-
return value;
|
|
28
|
-
}`;
|
|
29
|
-
}
|
|
30
|
-
function emitCppDecoderSource(functionName = "decodeDynamicObjectFromJsonObject") {
|
|
31
|
-
const comment = (0, comments_1.emitStrategyComment)("AnQst.Type.object — C++ decode (QJsonObject → QVariantMap)", [
|
|
32
|
-
"Caller obtains QJsonObject from QJsonValue::toObject(); this helper maps to QVariantMap.",
|
|
33
|
-
"Thin QVariantMap-oriented helper; Qt headers required to compile."
|
|
34
|
-
]);
|
|
35
|
-
return `${comment}
|
|
36
|
-
inline QVariantMap ${functionName}(const QJsonObject& obj) {
|
|
37
|
-
return obj.toVariantMap();
|
|
38
|
-
}`;
|
|
39
|
-
}
|
|
40
|
-
exports.decoder = {
|
|
41
|
-
descriptor: exports.descriptor,
|
|
42
|
-
emitTsDecoder: () => emitTsDecoderSource(),
|
|
43
|
-
emitCppDecoder: () => emitCppDecoderSource()
|
|
44
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* AnQst base-type codec emitter: AnQst.Type.object (dynamic object).
|
|
4
|
-
*
|
|
5
|
-
* Wire: the value is a native JSON object with no transformation — pass-through for
|
|
6
|
-
* JSON.stringify / JSON.parse. This path applies only where the spec explicitly declares
|
|
7
|
-
* AnQst.Type.object (or AnQst.Type.json for the sibling codec); it is never a fallback for
|
|
8
|
-
* statically typed fields. Contents must be JSON-native (see Dynamic_object_Codec.md).
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.encoder = exports.descriptor = void 0;
|
|
12
|
-
const comments_1 = require("../shared/comments");
|
|
13
|
-
exports.descriptor = {
|
|
14
|
-
codecId: "AnQst.Type.object",
|
|
15
|
-
specPath: "RefinedSpecs/Codecs/Dynamic_object_Codec.md",
|
|
16
|
-
tsType: "object",
|
|
17
|
-
cppType: "QVariantMap",
|
|
18
|
-
wireCategory: "dynamic",
|
|
19
|
-
strategySummary: "Pass-through JSON Object on the wire for explicitly dynamic AnQst.Type.object only; no base93, no flattening."
|
|
20
|
-
};
|
|
21
|
-
function emitTsEncoderSource(functionName = "encodeDynamicObject") {
|
|
22
|
-
const comment = (0, comments_1.emitStrategyComment)("AnQst.Type.object — TypeScript encode (identity on wire payload)", [
|
|
23
|
-
"The domain object is emitted as-is; the surrounding codec / JSON.stringify supplies JSON Object syntax.",
|
|
24
|
-
"Reserved for spec-declared dynamic object fields or standalone dynamic payloads — not for static struct shapes.",
|
|
25
|
-
"Values must be JSON-serializable; non-JSON-native values fail at stringify time."
|
|
26
|
-
]);
|
|
27
|
-
return `${comment}
|
|
28
|
-
function ${functionName}(value) {
|
|
29
|
-
return value;
|
|
30
|
-
}`;
|
|
31
|
-
}
|
|
32
|
-
function emitCppEncoderSource(functionName = "encodeDynamicObjectToJsonObject") {
|
|
33
|
-
const comment = (0, comments_1.emitStrategyComment)("AnQst.Type.object — C++ encode (QVariantMap → QJsonObject)", [
|
|
34
|
-
"Qt maps the domain QVariantMap to QJsonObject for JSON emission via QJsonObject::fromVariantMap.",
|
|
35
|
-
"Use only for explicit AnQst.Type.object; requires Qt JSON types in the translation unit."
|
|
36
|
-
]);
|
|
37
|
-
return `${comment}
|
|
38
|
-
inline QJsonObject ${functionName}(const QVariantMap& map) {
|
|
39
|
-
return QJsonObject::fromVariantMap(map);
|
|
40
|
-
}`;
|
|
41
|
-
}
|
|
42
|
-
exports.encoder = {
|
|
43
|
-
descriptor: exports.descriptor,
|
|
44
|
-
emitTsEncoder: () => emitTsEncoderSource(),
|
|
45
|
-
emitCppEncoder: () => emitCppEncoderSource()
|
|
46
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Base codec emitter: `AnQst.Type.int16` standalone decoder.
|
|
4
|
-
*
|
|
5
|
-
* Decoding mirrors `AnQst.Type.qint16`: base93 expands to 2 bytes, then
|
|
6
|
-
* `Int16Array` reconstructs the signed 16-bit two's complement value in native
|
|
7
|
-
* byte order. Descriptor identity remains separate so generated C++ binds to
|
|
8
|
-
* `int16_t`, not Qt's `qint16`.
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.decoderEmitter = exports.descriptor = void 0;
|
|
12
|
-
const comments_1 = require("../shared/comments");
|
|
13
|
-
const fixedwidth_1 = require("../shared/fixedwidth");
|
|
14
|
-
const encoder_1 = require("./encoder");
|
|
15
|
-
Object.defineProperty(exports, "descriptor", { enumerable: true, get: function () { return encoder_1.descriptor; } });
|
|
16
|
-
const FIXED_WIDTH = encoder_1.descriptor.fixedWidth;
|
|
17
|
-
const TS_FN = "decodeInt16Standalone";
|
|
18
|
-
const CPP_FN = "decodeInt16Standalone";
|
|
19
|
-
const STRATEGY_COMMENT = (0, comments_1.emitStrategyComment)("Base codec emitter (decode): AnQst.Type.int16 / int16_t", [
|
|
20
|
-
"Base93 decodes to exactly 2 bytes, then Int16Array reconstructs the signed 16-bit value in TypeScript.",
|
|
21
|
-
"The standalone wire remains the same 3-character payload used by qint16.",
|
|
22
|
-
"C++ decodes into int16_t with memcpy so the descriptor maps to the standard typedef, not qint16."
|
|
23
|
-
]);
|
|
24
|
-
exports.decoderEmitter = {
|
|
25
|
-
descriptor: encoder_1.descriptor,
|
|
26
|
-
emitTsDecoder() {
|
|
27
|
-
return `${STRATEGY_COMMENT}\n\n${(0, fixedwidth_1.emitTsFixedWidthStandaloneDecoder)(TS_FN, FIXED_WIDTH)}`;
|
|
28
|
-
},
|
|
29
|
-
emitCppDecoder() {
|
|
30
|
-
return `${STRATEGY_COMMENT}\n\n${(0, fixedwidth_1.emitCppFixedWidthStandaloneDecoder)(CPP_FN, FIXED_WIDTH)}`;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Base codec emitter: `AnQst.Type.int16` standalone encoder.
|
|
4
|
-
*
|
|
5
|
-
* This codec is wire-identical to `AnQst.Type.qint16`: it writes the signed
|
|
6
|
-
* 16-bit two's complement value through `Int16Array`, then base93-encodes the
|
|
7
|
-
* resulting 2 native-order bytes as a 3-character standalone string. The
|
|
8
|
-
* descriptor stays distinct so generated C++ uses standard `int16_t`.
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.encoderEmitter = exports.descriptor = void 0;
|
|
12
|
-
const comments_1 = require("../shared/comments");
|
|
13
|
-
const fixedwidth_1 = require("../shared/fixedwidth");
|
|
14
|
-
const FIXED_WIDTH = {
|
|
15
|
-
byteWidth: 2,
|
|
16
|
-
tsViewCtor: "Int16Array",
|
|
17
|
-
cppType: "int16_t"
|
|
18
|
-
};
|
|
19
|
-
exports.descriptor = {
|
|
20
|
-
codecId: "integer-int16",
|
|
21
|
-
specPath: "RefinedSpecs/Codecs/Integer_int16_Codec.md",
|
|
22
|
-
tsType: "number",
|
|
23
|
-
cppType: "int16_t",
|
|
24
|
-
wireCategory: "fixed-width-scalar",
|
|
25
|
-
strategySummary: "Wire-identical to qint16: serialize signed 16-bit two's complement via Int16Array / int16_t, then base93-encode the 2-byte standalone payload to 3 characters.",
|
|
26
|
-
fixedWidth: FIXED_WIDTH
|
|
27
|
-
};
|
|
28
|
-
const TS_FN = "encodeInt16Standalone";
|
|
29
|
-
const CPP_FN = "encodeInt16Standalone";
|
|
30
|
-
const STRATEGY_COMMENT = (0, comments_1.emitStrategyComment)("Base codec emitter (encode): AnQst.Type.int16 / int16_t", [
|
|
31
|
-
"Wire-identical to qint16: TypeScript writes the signed 16-bit payload through Int16Array.",
|
|
32
|
-
"Standalone payload width is fixed at 2 bytes, which base93 encodes to exactly 3 characters.",
|
|
33
|
-
"C++ mirrors the same native-order bytes with memcpy into int16_t rather than Qt's qint16 typedef."
|
|
34
|
-
]);
|
|
35
|
-
exports.encoderEmitter = {
|
|
36
|
-
descriptor: exports.descriptor,
|
|
37
|
-
emitTsEncoder() {
|
|
38
|
-
return `${STRATEGY_COMMENT}\n\n${(0, fixedwidth_1.emitTsFixedWidthStandaloneEncoder)(TS_FN, FIXED_WIDTH)}`;
|
|
39
|
-
},
|
|
40
|
-
emitCppEncoder() {
|
|
41
|
-
return `${STRATEGY_COMMENT}\n\n${(0, fixedwidth_1.emitCppFixedWidthStandaloneEncoder)(CPP_FN, FIXED_WIDTH)}`;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Base codec emitter: `AnQst.Type.int32` standalone decoder.
|
|
4
|
-
*
|
|
5
|
-
* Decodes the same 5-character base93 wire used by `AnQst.Type.qint32`, then
|
|
6
|
-
* reconstructs the signed 32-bit two's complement value through `Int32Array`.
|
|
7
|
-
* Descriptor identity remains distinct so generated C++ uses `int32_t`, not
|
|
8
|
-
* Qt's `qint32`, even though the wire bytes are identical.
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.decoderEmitter = exports.descriptor = void 0;
|
|
12
|
-
const fixedwidth_1 = require("../shared/fixedwidth");
|
|
13
|
-
const encoder_1 = require("./encoder");
|
|
14
|
-
Object.defineProperty(exports, "descriptor", { enumerable: true, get: function () { return encoder_1.descriptor; } });
|
|
15
|
-
const FIXED_WIDTH = encoder_1.descriptor.fixedWidth;
|
|
16
|
-
const TS_FN = "decodeInt32Standalone";
|
|
17
|
-
const CPP_FN = "decodeInt32Standalone";
|
|
18
|
-
exports.decoderEmitter = {
|
|
19
|
-
descriptor: encoder_1.descriptor,
|
|
20
|
-
emitTsDecoder() {
|
|
21
|
-
return (0, fixedwidth_1.emitTsFixedWidthStandaloneDecoder)(TS_FN, FIXED_WIDTH);
|
|
22
|
-
},
|
|
23
|
-
emitCppDecoder() {
|
|
24
|
-
return (0, fixedwidth_1.emitCppFixedWidthStandaloneDecoder)(CPP_FN, FIXED_WIDTH);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Base codec emitter: `AnQst.Type.int32` standalone encoder.
|
|
4
|
-
*
|
|
5
|
-
* Wire behavior is intentionally identical to `AnQst.Type.qint32`: serialize
|
|
6
|
-
* one signed 32-bit two's complement word via `Int32Array`, then base93-encode
|
|
7
|
-
* those 4 bytes into a 5-character standalone string. The distinction lives
|
|
8
|
-
* only in descriptor identity and C++ mapping: this codec targets `int32_t`.
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.encoderEmitter = exports.descriptor = void 0;
|
|
12
|
-
const fixedwidth_1 = require("../shared/fixedwidth");
|
|
13
|
-
const FIXED_WIDTH = {
|
|
14
|
-
byteWidth: 4,
|
|
15
|
-
tsViewCtor: "Int32Array",
|
|
16
|
-
cppType: "int32_t"
|
|
17
|
-
};
|
|
18
|
-
exports.descriptor = {
|
|
19
|
-
codecId: "integer-int32",
|
|
20
|
-
specPath: "RefinedSpecs/Codecs/Integer_int32_Codec.md",
|
|
21
|
-
tsType: "number",
|
|
22
|
-
cppType: "int32_t",
|
|
23
|
-
wireCategory: "fixed-width-scalar",
|
|
24
|
-
strategySummary: "Wire-identical to qint32: serialize int32_t as 4-byte signed two's complement (Int32Array / C++ memcpy), then base93-encode to a standalone 5-character JSON string.",
|
|
25
|
-
fixedWidth: FIXED_WIDTH
|
|
26
|
-
};
|
|
27
|
-
const TS_FN = "encodeInt32Standalone";
|
|
28
|
-
const CPP_FN = "encodeInt32Standalone";
|
|
29
|
-
exports.encoderEmitter = {
|
|
30
|
-
descriptor: exports.descriptor,
|
|
31
|
-
emitTsEncoder() {
|
|
32
|
-
return (0, fixedwidth_1.emitTsFixedWidthStandaloneEncoder)(TS_FN, FIXED_WIDTH);
|
|
33
|
-
},
|
|
34
|
-
emitCppEncoder() {
|
|
35
|
-
return (0, fixedwidth_1.emitCppFixedWidthStandaloneEncoder)(CPP_FN, FIXED_WIDTH);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Base codec emitter: `AnQst.Type.int8` standalone decoder.
|
|
4
|
-
*
|
|
5
|
-
* Decodes the same 2-character base93 wire used by `AnQst.Type.qint8`, then
|
|
6
|
-
* reconstructs the signed 8-bit two's complement value through `Int8Array`.
|
|
7
|
-
* Descriptor identity remains distinct so generated C++ uses `int8_t`, not Qt's
|
|
8
|
-
* `qint8`, even though the wire bytes are identical.
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.decoderEmitter = exports.descriptor = void 0;
|
|
12
|
-
const fixedwidth_1 = require("../shared/fixedwidth");
|
|
13
|
-
const encoder_1 = require("./encoder");
|
|
14
|
-
Object.defineProperty(exports, "descriptor", { enumerable: true, get: function () { return encoder_1.descriptor; } });
|
|
15
|
-
const fixedWidth = encoder_1.descriptor.fixedWidth;
|
|
16
|
-
const TS_FN = "decodeInt8Standalone";
|
|
17
|
-
const CPP_FN = "decodeInt8Standalone";
|
|
18
|
-
exports.decoderEmitter = {
|
|
19
|
-
descriptor: encoder_1.descriptor,
|
|
20
|
-
emitTsDecoder() {
|
|
21
|
-
return (0, fixedwidth_1.emitTsFixedWidthStandaloneDecoder)(TS_FN, fixedWidth);
|
|
22
|
-
},
|
|
23
|
-
emitCppDecoder() {
|
|
24
|
-
return (0, fixedwidth_1.emitCppFixedWidthStandaloneDecoder)(CPP_FN, fixedWidth);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Base codec emitter: `AnQst.Type.int8` standalone encoder.
|
|
4
|
-
*
|
|
5
|
-
* Wire behavior is intentionally identical to `AnQst.Type.qint8`: serialize one
|
|
6
|
-
* signed 8-bit two's complement byte via `Int8Array`, then base93-encode that
|
|
7
|
-
* single byte into a 2-character standalone string. The distinction lives only
|
|
8
|
-
* in descriptor identity and C++ mapping: this codec targets standard `int8_t`.
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.encoderEmitter = exports.descriptor = void 0;
|
|
12
|
-
const fixedwidth_1 = require("../shared/fixedwidth");
|
|
13
|
-
const fixedWidth = {
|
|
14
|
-
byteWidth: 1,
|
|
15
|
-
tsViewCtor: "Int8Array",
|
|
16
|
-
cppType: "int8_t"
|
|
17
|
-
};
|
|
18
|
-
exports.descriptor = {
|
|
19
|
-
codecId: "integer-int8",
|
|
20
|
-
specPath: "RefinedSpecs/Codecs/Integer_int8_Codec.md",
|
|
21
|
-
tsType: "number",
|
|
22
|
-
cppType: "int8_t",
|
|
23
|
-
wireCategory: "fixed-width-scalar",
|
|
24
|
-
strategySummary: "Wire-identical to qint8: one signed two's complement byte via Int8Array / int8_t, base93-encoded as a 2-character standalone string.",
|
|
25
|
-
fixedWidth
|
|
26
|
-
};
|
|
27
|
-
const TS_FN = "encodeInt8Standalone";
|
|
28
|
-
const CPP_FN = "encodeInt8Standalone";
|
|
29
|
-
exports.encoderEmitter = {
|
|
30
|
-
descriptor: exports.descriptor,
|
|
31
|
-
emitTsEncoder() {
|
|
32
|
-
return (0, fixedwidth_1.emitTsFixedWidthStandaloneEncoder)(TS_FN, fixedWidth);
|
|
33
|
-
},
|
|
34
|
-
emitCppEncoder() {
|
|
35
|
-
return (0, fixedwidth_1.emitCppFixedWidthStandaloneEncoder)(CPP_FN, fixedWidth);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Base codec emitter: AnQst.Type.qint16 — TypeScript decoder (standalone base93 string → number).
|
|
4
|
-
*
|
|
5
|
-
* - Decodes base93 to 2 bytes, then reads signed 16-bit two's complement via Int16Array.
|
|
6
|
-
* - Returns the JavaScript number represented by that qint16 payload.
|
|
7
|
-
* - C++ side performs the same memcpy-based reinterpretation into qint16.
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.decoderEmitter = exports.descriptor = void 0;
|
|
11
|
-
const fixedwidth_1 = require("../shared/fixedwidth");
|
|
12
|
-
const FIXED_WIDTH = {
|
|
13
|
-
byteWidth: 2,
|
|
14
|
-
tsViewCtor: "Int16Array",
|
|
15
|
-
cppType: "qint16"
|
|
16
|
-
};
|
|
17
|
-
exports.descriptor = {
|
|
18
|
-
codecId: "integer-qint16",
|
|
19
|
-
specPath: "RefinedSpecs/Codecs/Integer_qint16_Codec.md",
|
|
20
|
-
tsType: "number",
|
|
21
|
-
cppType: "qint16",
|
|
22
|
-
wireCategory: "fixed-width-scalar",
|
|
23
|
-
strategySummary: "Decode standalone base93 to 2 bytes, reinterpret them as qint16 / Int16Array[0] and return the resulting number.",
|
|
24
|
-
fixedWidth: FIXED_WIDTH
|
|
25
|
-
};
|
|
26
|
-
const TS_FN = "decodeQint16Standalone";
|
|
27
|
-
const CPP_FN = "decodeQint16Standalone";
|
|
28
|
-
exports.decoderEmitter = {
|
|
29
|
-
descriptor: exports.descriptor,
|
|
30
|
-
emitTsDecoder() {
|
|
31
|
-
return (0, fixedwidth_1.emitTsFixedWidthStandaloneDecoder)(TS_FN, FIXED_WIDTH);
|
|
32
|
-
},
|
|
33
|
-
emitCppDecoder() {
|
|
34
|
-
return (0, fixedwidth_1.emitCppFixedWidthStandaloneDecoder)(CPP_FN, FIXED_WIDTH);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Base codec emitter: AnQst.Type.qint16 — TypeScript encoder (number → standalone base93 string).
|
|
4
|
-
*
|
|
5
|
-
* - 2-byte signed two's complement via Int16Array; platform-native byte order.
|
|
6
|
-
* - Standalone wire: one base93 string (3 characters for 2 bytes).
|
|
7
|
-
* - C++ side mirrors layout with memcpy into qint16, keeping TS/C++ interop portable.
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.encoderEmitter = exports.descriptor = void 0;
|
|
11
|
-
const fixedwidth_1 = require("../shared/fixedwidth");
|
|
12
|
-
const FIXED_WIDTH = {
|
|
13
|
-
byteWidth: 2,
|
|
14
|
-
tsViewCtor: "Int16Array",
|
|
15
|
-
cppType: "qint16"
|
|
16
|
-
};
|
|
17
|
-
exports.descriptor = {
|
|
18
|
-
codecId: "integer-qint16",
|
|
19
|
-
specPath: "RefinedSpecs/Codecs/Integer_qint16_Codec.md",
|
|
20
|
-
tsType: "number",
|
|
21
|
-
cppType: "qint16",
|
|
22
|
-
wireCategory: "fixed-width-scalar",
|
|
23
|
-
strategySummary: "Serialize qint16 as 2-byte signed two's complement (Int16Array / C++ memcpy), then base93-encode to a standalone JSON string.",
|
|
24
|
-
fixedWidth: FIXED_WIDTH
|
|
25
|
-
};
|
|
26
|
-
const TS_FN = "encodeQint16Standalone";
|
|
27
|
-
const CPP_FN = "encodeQint16Standalone";
|
|
28
|
-
exports.encoderEmitter = {
|
|
29
|
-
descriptor: exports.descriptor,
|
|
30
|
-
emitTsEncoder() {
|
|
31
|
-
return (0, fixedwidth_1.emitTsFixedWidthStandaloneEncoder)(TS_FN, FIXED_WIDTH);
|
|
32
|
-
},
|
|
33
|
-
emitCppEncoder() {
|
|
34
|
-
return (0, fixedwidth_1.emitCppFixedWidthStandaloneEncoder)(CPP_FN, FIXED_WIDTH);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Base codec emitter: AnQst.Type.qint32 — TypeScript decoder (standalone base93 string → number).
|
|
4
|
-
*
|
|
5
|
-
* - Decodes base93 to 4 bytes, then reads signed 32-bit two's complement via Int32Array.
|
|
6
|
-
* - Returns the JavaScript number represented by that qint32 payload.
|
|
7
|
-
* - C++ side performs the same 4-byte reinterpretation with memcpy into qint32.
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.decoderEmitter = exports.descriptor = void 0;
|
|
11
|
-
const fixedwidth_1 = require("../shared/fixedwidth");
|
|
12
|
-
const encoder_1 = require("./encoder");
|
|
13
|
-
Object.defineProperty(exports, "descriptor", { enumerable: true, get: function () { return encoder_1.descriptor; } });
|
|
14
|
-
const FIXED_WIDTH = encoder_1.descriptor.fixedWidth;
|
|
15
|
-
const TS_FN = "decodeQint32Standalone";
|
|
16
|
-
const CPP_FN = "decodeQint32Standalone";
|
|
17
|
-
exports.decoderEmitter = {
|
|
18
|
-
descriptor: encoder_1.descriptor,
|
|
19
|
-
emitTsDecoder() {
|
|
20
|
-
return (0, fixedwidth_1.emitTsFixedWidthStandaloneDecoder)(TS_FN, FIXED_WIDTH);
|
|
21
|
-
},
|
|
22
|
-
emitCppDecoder() {
|
|
23
|
-
return (0, fixedwidth_1.emitCppFixedWidthStandaloneDecoder)(CPP_FN, FIXED_WIDTH);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Base codec emitter: AnQst.Type.qint32 — TypeScript encoder (number → standalone base93 string).
|
|
4
|
-
*
|
|
5
|
-
* - 4-byte signed two's complement via Int32Array; platform-native byte order.
|
|
6
|
-
* - Standalone wire: one base93 string (5 characters for 4 bytes).
|
|
7
|
-
* - C++ side mirrors the same 4-byte layout with memcpy into qint32.
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.encoderEmitter = exports.descriptor = void 0;
|
|
11
|
-
const fixedwidth_1 = require("../shared/fixedwidth");
|
|
12
|
-
const FIXED_WIDTH = {
|
|
13
|
-
byteWidth: 4,
|
|
14
|
-
tsViewCtor: "Int32Array",
|
|
15
|
-
cppType: "qint32"
|
|
16
|
-
};
|
|
17
|
-
exports.descriptor = {
|
|
18
|
-
codecId: "integer-qint32",
|
|
19
|
-
specPath: "RefinedSpecs/Codecs/Integer_qint32_Codec.md",
|
|
20
|
-
tsType: "number",
|
|
21
|
-
cppType: "qint32",
|
|
22
|
-
wireCategory: "fixed-width-scalar",
|
|
23
|
-
strategySummary: "Serialize qint32 as 4-byte signed two's complement (Int32Array / C++ memcpy), then base93-encode to a standalone 5-character JSON string.",
|
|
24
|
-
fixedWidth: FIXED_WIDTH
|
|
25
|
-
};
|
|
26
|
-
const TS_FN = "encodeQint32Standalone";
|
|
27
|
-
const CPP_FN = "encodeQint32Standalone";
|
|
28
|
-
exports.encoderEmitter = {
|
|
29
|
-
descriptor: exports.descriptor,
|
|
30
|
-
emitTsEncoder() {
|
|
31
|
-
return (0, fixedwidth_1.emitTsFixedWidthStandaloneEncoder)(TS_FN, FIXED_WIDTH);
|
|
32
|
-
},
|
|
33
|
-
emitCppEncoder() {
|
|
34
|
-
return (0, fixedwidth_1.emitCppFixedWidthStandaloneEncoder)(CPP_FN, FIXED_WIDTH);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Base codec emitter: AnQst.Type.qint8 — TypeScript decoder (standalone base93 string → number).
|
|
4
|
-
*
|
|
5
|
-
* - Decodes base93 to 1 byte, then reads signed 8-bit two's complement via Int8Array.
|
|
6
|
-
* - Returns the JavaScript number represented by that single signed byte.
|
|
7
|
-
* - C++ side performs the same single-byte reinterpretation, which is portable for qint8.
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.decoderEmitter = exports.descriptor = void 0;
|
|
11
|
-
const fixedwidth_1 = require("../shared/fixedwidth");
|
|
12
|
-
const FIXED_WIDTH = {
|
|
13
|
-
byteWidth: 1,
|
|
14
|
-
tsViewCtor: "Int8Array",
|
|
15
|
-
cppType: "qint8"
|
|
16
|
-
};
|
|
17
|
-
exports.descriptor = {
|
|
18
|
-
codecId: "integer-qint8",
|
|
19
|
-
specPath: "RefinedSpecs/Codecs/Integer_qint8_Codec.md",
|
|
20
|
-
tsType: "number",
|
|
21
|
-
cppType: "qint8",
|
|
22
|
-
wireCategory: "fixed-width-scalar",
|
|
23
|
-
strategySummary: "Decode standalone base93 to 1 byte, reinterpret it as qint8 / Int8Array[0] and return the resulting number.",
|
|
24
|
-
fixedWidth: FIXED_WIDTH
|
|
25
|
-
};
|
|
26
|
-
const TS_FN = "decodeQint8Standalone";
|
|
27
|
-
const CPP_FN = "decodeQint8Standalone";
|
|
28
|
-
exports.decoderEmitter = {
|
|
29
|
-
descriptor: exports.descriptor,
|
|
30
|
-
emitTsDecoder() {
|
|
31
|
-
return (0, fixedwidth_1.emitTsFixedWidthStandaloneDecoder)(TS_FN, FIXED_WIDTH);
|
|
32
|
-
},
|
|
33
|
-
emitCppDecoder() {
|
|
34
|
-
return (0, fixedwidth_1.emitCppFixedWidthStandaloneDecoder)(CPP_FN, FIXED_WIDTH);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Base codec emitter: AnQst.Type.qint8 — TypeScript encoder (number → standalone base93 string).
|
|
4
|
-
*
|
|
5
|
-
* - 1-byte signed two's complement via Int8Array; no runtime range/type validation.
|
|
6
|
-
* - Standalone wire: one base93 string (2 characters for 1 byte).
|
|
7
|
-
* - C++ side mirrors the same single-byte layout, so interoperability is portable.
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.encoderEmitter = exports.descriptor = void 0;
|
|
11
|
-
const fixedwidth_1 = require("../shared/fixedwidth");
|
|
12
|
-
const FIXED_WIDTH = {
|
|
13
|
-
byteWidth: 1,
|
|
14
|
-
tsViewCtor: "Int8Array",
|
|
15
|
-
cppType: "qint8"
|
|
16
|
-
};
|
|
17
|
-
exports.descriptor = {
|
|
18
|
-
codecId: "integer-qint8",
|
|
19
|
-
specPath: "RefinedSpecs/Codecs/Integer_qint8_Codec.md",
|
|
20
|
-
tsType: "number",
|
|
21
|
-
cppType: "qint8",
|
|
22
|
-
wireCategory: "fixed-width-scalar",
|
|
23
|
-
strategySummary: "Serialize qint8 as 1-byte signed two's complement (Int8Array / single C++ byte), then base93-encode to a standalone JSON string.",
|
|
24
|
-
fixedWidth: FIXED_WIDTH
|
|
25
|
-
};
|
|
26
|
-
const TS_FN = "encodeQint8Standalone";
|
|
27
|
-
const CPP_FN = "encodeQint8Standalone";
|
|
28
|
-
exports.encoderEmitter = {
|
|
29
|
-
descriptor: exports.descriptor,
|
|
30
|
-
emitTsEncoder() {
|
|
31
|
-
return (0, fixedwidth_1.emitTsFixedWidthStandaloneEncoder)(TS_FN, FIXED_WIDTH);
|
|
32
|
-
},
|
|
33
|
-
emitCppEncoder() {
|
|
34
|
-
return (0, fixedwidth_1.emitCppFixedWidthStandaloneEncoder)(CPP_FN, FIXED_WIDTH);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Base codec emitter (decode): base93 blob → TypeScript `number`, C++ `quint16`.
|
|
4
|
-
* Reconstructs the platform-native 2-byte unsigned scalar from a 3-character base93 payload.
|
|
5
|
-
* See RefinedSpecs/Codecs/Integer_quint16_Codec.md.
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.decoderEmitter = exports.descriptor = void 0;
|
|
9
|
-
const comments_1 = require("../shared/comments");
|
|
10
|
-
const fixedwidth_1 = require("../shared/fixedwidth");
|
|
11
|
-
const encoder_1 = require("./encoder");
|
|
12
|
-
Object.defineProperty(exports, "descriptor", { enumerable: true, get: function () { return encoder_1.descriptor; } });
|
|
13
|
-
const strategyComment = (0, comments_1.emitStrategyComment)("Base codec emitter (decode): AnQst.Type.quint16 / quint16", [
|
|
14
|
-
"Decodes base93 to exactly 2 bytes, then reads Uint16Array[0] in TypeScript or quint16 in C++.",
|
|
15
|
-
"Standalone payloads are fixed-width and therefore always 3 base93 characters for valid quint16 values.",
|
|
16
|
-
"Portable interoperability is byte-exact because both sides reinterpret the same 2 decoded bytes as quint16."
|
|
17
|
-
]);
|
|
18
|
-
exports.decoderEmitter = {
|
|
19
|
-
descriptor: encoder_1.descriptor,
|
|
20
|
-
emitTsDecoder() {
|
|
21
|
-
return `${strategyComment}\n\n${(0, fixedwidth_1.emitTsFixedWidthStandaloneDecoder)("decodeQuint16Standalone", encoder_1.descriptor.fixedWidth)}`;
|
|
22
|
-
},
|
|
23
|
-
emitCppDecoder() {
|
|
24
|
-
return `${strategyComment}\n\n${(0, fixedwidth_1.emitCppFixedWidthStandaloneDecoder)("decodeQuint16Standalone", encoder_1.descriptor.fixedWidth)}`;
|
|
25
|
-
}
|
|
26
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Base codec emitter (encode): AnQst.Type.quint16 ↔ TypeScript `number`, C++ `quint16`.
|
|
4
|
-
* Standalone wire shape is one 3-character base93 string carrying exactly 2 raw bytes.
|
|
5
|
-
* See RefinedSpecs/Codecs/Integer_quint16_Codec.md.
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.encoderEmitter = exports.descriptor = void 0;
|
|
9
|
-
const comments_1 = require("../shared/comments");
|
|
10
|
-
const fixedwidth_1 = require("../shared/fixedwidth");
|
|
11
|
-
const FIXED_WIDTH = {
|
|
12
|
-
byteWidth: 2,
|
|
13
|
-
tsViewCtor: "Uint16Array",
|
|
14
|
-
cppType: "quint16"
|
|
15
|
-
};
|
|
16
|
-
exports.descriptor = {
|
|
17
|
-
codecId: "integer-quint16",
|
|
18
|
-
specPath: "RefinedSpecs/Codecs/Integer_quint16_Codec.md",
|
|
19
|
-
tsType: "number",
|
|
20
|
-
cppType: "quint16",
|
|
21
|
-
wireCategory: "fixed-width-scalar",
|
|
22
|
-
strategySummary: "Unsigned 16-bit scalar: write the platform-native 2-byte Uint16Array/quint16 representation, then base93-encode it to a 3-character standalone string.",
|
|
23
|
-
fixedWidth: FIXED_WIDTH
|
|
24
|
-
};
|
|
25
|
-
const strategyComment = (0, comments_1.emitStrategyComment)("Base codec emitter (encode): AnQst.Type.quint16 / quint16", [
|
|
26
|
-
"Uses Uint16Array[0] so TypeScript follows the quint16 prose for the host-native 2-byte unsigned representation.",
|
|
27
|
-
"Emits exactly 3 base93 characters for the standalone wire payload because 2 raw bytes are encoded directly.",
|
|
28
|
-
"C++ encoder memcpy-copies the same 2 bytes from quint16, preserving portable interop at the byte level."
|
|
29
|
-
]);
|
|
30
|
-
exports.encoderEmitter = {
|
|
31
|
-
descriptor: exports.descriptor,
|
|
32
|
-
emitTsEncoder() {
|
|
33
|
-
return `${strategyComment}\n\n${(0, fixedwidth_1.emitTsFixedWidthStandaloneEncoder)("encodeQuint16Standalone", FIXED_WIDTH)}`;
|
|
34
|
-
},
|
|
35
|
-
emitCppEncoder() {
|
|
36
|
-
return `${strategyComment}\n\n${(0, fixedwidth_1.emitCppFixedWidthStandaloneEncoder)("encodeQuint16Standalone", FIXED_WIDTH)}`;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Base codec emitter (decode): base93 blob → TypeScript `number`, C++ `quint32`.
|
|
4
|
-
* Reconstructs the 4-byte unsigned payload from a 5-character base93 string and
|
|
5
|
-
* reads it back through Uint32Array / quint32 in host-native byte order.
|
|
6
|
-
* See RefinedSpecs/Codecs/Integer_quint32_Codec.md.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.decoderEmitter = exports.descriptor = void 0;
|
|
10
|
-
const comments_1 = require("../shared/comments");
|
|
11
|
-
const fixedwidth_1 = require("../shared/fixedwidth");
|
|
12
|
-
const encoder_1 = require("./encoder");
|
|
13
|
-
Object.defineProperty(exports, "descriptor", { enumerable: true, get: function () { return encoder_1.descriptor; } });
|
|
14
|
-
const strategyComment = (0, comments_1.emitStrategyComment)("Base codec emitter (decode): AnQst.Type.quint32 / quint32", [
|
|
15
|
-
"Decodes base93 to 4 bytes, then reads Uint32Array[0] in TypeScript or quint32 in C++.",
|
|
16
|
-
"Standalone payloads are fixed-width and therefore always 5 base93 characters for valid quint32 values.",
|
|
17
|
-
"Portable interoperability is direct because both sides reinterpret the same 4 decoded bytes."
|
|
18
|
-
]);
|
|
19
|
-
exports.decoderEmitter = {
|
|
20
|
-
descriptor: encoder_1.descriptor,
|
|
21
|
-
emitTsDecoder() {
|
|
22
|
-
return `${strategyComment}\n\n${(0, fixedwidth_1.emitTsFixedWidthStandaloneDecoder)("decodeQuint32Standalone", encoder_1.descriptor.fixedWidth)}`;
|
|
23
|
-
},
|
|
24
|
-
emitCppDecoder() {
|
|
25
|
-
return `${strategyComment}\n\n${(0, fixedwidth_1.emitCppFixedWidthStandaloneDecoder)("decodeQuint32Standalone", encoder_1.descriptor.fixedWidth)}`;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Base codec emitter (encode): AnQst.Type.quint32 ↔ TypeScript `number`, C++ `quint32`.
|
|
4
|
-
* Standalone wire shape is one 5-character base93 string carrying exactly 4 bytes
|
|
5
|
-
* from a Uint32Array host-native unsigned 32-bit representation.
|
|
6
|
-
* See RefinedSpecs/Codecs/Integer_quint32_Codec.md.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.encoderEmitter = exports.descriptor = void 0;
|
|
10
|
-
const comments_1 = require("../shared/comments");
|
|
11
|
-
const fixedwidth_1 = require("../shared/fixedwidth");
|
|
12
|
-
const FIXED_WIDTH = {
|
|
13
|
-
byteWidth: 4,
|
|
14
|
-
tsViewCtor: "Uint32Array",
|
|
15
|
-
cppType: "quint32"
|
|
16
|
-
};
|
|
17
|
-
exports.descriptor = {
|
|
18
|
-
codecId: "integer-quint32",
|
|
19
|
-
specPath: "RefinedSpecs/Codecs/Integer_quint32_Codec.md",
|
|
20
|
-
tsType: "number",
|
|
21
|
-
cppType: "quint32",
|
|
22
|
-
wireCategory: "fixed-width-scalar",
|
|
23
|
-
strategySummary: "Unsigned 32-bit scalar: materialize 4 host-native bytes via Uint32Array/quint32, then base93-encode them to a standalone 5-character string.",
|
|
24
|
-
fixedWidth: FIXED_WIDTH
|
|
25
|
-
};
|
|
26
|
-
const strategyComment = (0, comments_1.emitStrategyComment)("Base codec emitter (encode): AnQst.Type.quint32 / quint32", [
|
|
27
|
-
"Uses Uint32Array[0] so TypeScript follows the quint32 prose for 4-byte unsigned materialization.",
|
|
28
|
-
"Emits exactly 5 base93 characters for the standalone wire payload.",
|
|
29
|
-
"C++ encoder memcpy-copies the quint32 bytes, matching the TypeScript wire byte-for-byte on the same host."
|
|
30
|
-
]);
|
|
31
|
-
exports.encoderEmitter = {
|
|
32
|
-
descriptor: exports.descriptor,
|
|
33
|
-
emitTsEncoder() {
|
|
34
|
-
return `${strategyComment}\n\n${(0, fixedwidth_1.emitTsFixedWidthStandaloneEncoder)("encodeQuint32Standalone", FIXED_WIDTH)}`;
|
|
35
|
-
},
|
|
36
|
-
emitCppEncoder() {
|
|
37
|
-
return `${strategyComment}\n\n${(0, fixedwidth_1.emitCppFixedWidthStandaloneEncoder)("encodeQuint32Standalone", FIXED_WIDTH)}`;
|
|
38
|
-
}
|
|
39
|
-
};
|