diff --git a/jsroot/types/string/read.mjs b/jsroot/types/string/read.mjs new file mode 100644 index 0000000..f68df06 --- /dev/null +++ b/jsroot/types/string/read.mjs @@ -0,0 +1,13 @@ +import { read } from "../../jsroot_reader.mjs"; + +function getUtf8decoding(s) { + const bytes = Uint8Array.from(s, (c) => c.charCodeAt(0)); + return new TextDecoder("utf-8").decode(bytes); +} + +const fields = ["Index32", "Index64", "SplitIndex32", "SplitIndex64"]; + +const [input = "types.string.root", output = "types.string.json"] = + process.argv.slice(2); + +read(input, output, fields, getUtf8decoding); diff --git a/jsroot/types/variant/read.mjs b/jsroot/types/variant/read.mjs new file mode 100644 index 0000000..d659129 --- /dev/null +++ b/jsroot/types/variant/read.mjs @@ -0,0 +1,8 @@ +import { read } from "../../jsroot_reader.mjs"; + +const fields = ["f", "Vector"]; + +const [input = "types.variant.root", output = "types.variant.json"] = + process.argv.slice(2); + +read(input, output, fields); diff --git a/jsroot/types/vector/README.md b/jsroot/types/vector/README.md new file mode 100644 index 0000000..cddafec --- /dev/null +++ b/jsroot/types/vector/README.md @@ -0,0 +1,4 @@ +# `std::vector` + + * [`fundamental`](fundamental): `std::vector` + * [`nested`](nested): `std::vector>` diff --git a/jsroot/types/vector/fundamental/read.mjs b/jsroot/types/vector/fundamental/read.mjs new file mode 100644 index 0000000..8b1b27c --- /dev/null +++ b/jsroot/types/vector/fundamental/read.mjs @@ -0,0 +1,10 @@ +import { read } from "../../../jsroot_reader.mjs"; + +const fields = ["Index32", "Index64", "SplitIndex32", "SplitIndex64"]; + +const [ + input = "types.vector.fundamental.root", + output = "types.vector.fundamental.json", +] = process.argv.slice(2); + +read(input, output, fields); diff --git a/jsroot/types/vector/nested/read.mjs b/jsroot/types/vector/nested/read.mjs new file mode 100644 index 0000000..2658ddc --- /dev/null +++ b/jsroot/types/vector/nested/read.mjs @@ -0,0 +1,10 @@ +import { read } from "../../../jsroot_reader.mjs"; + +const fields = ["Index32", "Index64", "SplitIndex32", "SplitIndex64"]; + +const [ + input = "types.vector.nested.root", + output = "types.vector.nested.json", +] = process.argv.slice(2); + +read(input, output, fields);