aboutsummaryrefslogtreecommitdiff
path: root/scripts/rcc_format.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/rcc_format.py')
-rw-r--r--scripts/rcc_format.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/rcc_format.py b/scripts/rcc_format.py
index d0ab06d..7fcfe34 100644
--- a/scripts/rcc_format.py
+++ b/scripts/rcc_format.py
@@ -37,7 +37,7 @@ def write_header(file, namespace):
def write_item(file, array_name, array_data):
line_items = 0
- print("constexpr unsigned char {}[] = {{".format(array_name), file=file)
+ print("constexpr uint8_t {}[] = {{".format(array_name), file=file)
for byte in array_data[0:len(array_data)]:
line_items+=1
@@ -52,10 +52,15 @@ def write_item(file, array_name, array_data):
print("constexpr size_t {}_len = {};\n".format(array_name, len(array_data)), file=file)
def write_entries(file, resource_list):
- print("constexpr auto entries = frozen::make_unordered_map<frozen::string, std::span<const unsigned char>>({", file=file)
+ print("constexpr std::array entries {", file=file)
for f in resource_list:
- print(" {{ \"{}\", std::span({}, {}_len) }},".format(f.alias, f.variable, f.variable), file=file)
- print("});\n", file=file)
+ print(" \"{}\", ".format(f.alias), file=file)
+ print("};\n", file=file)
+
+ print("constexpr std::array values {", file=file)
+ for f in resource_list:
+ print(" std::span( {}, {}_len ),".format(f.variable, f.variable), file=file)
+ print("};\n", file=file)
def write_footer(file, namespace):
print("\n}} // namespace {}".format(namespace), file=file)