Programmatically create the readables and writables mappings.

This commit is contained in:
David Given
2021-05-13 19:39:45 +02:00
parent 5a186b6960
commit a3bd7cc644
8 changed files with 95 additions and 49 deletions

19
scripts/mktable.sh Normal file
View File

@@ -0,0 +1,19 @@
#!/bin/sh
echo "#include <string>"
echo "#include <map>"
word=$1
shift
for a in "$@"; do
echo "extern std::string ${word}_${a}_pb();"
done
echo "extern const std::map<std::string, std::string> ${word};"
echo "const std::map<std::string, std::string> ${word} = {"
for a in "$@"; do
echo " { \"${a}\", ${word}_${a}_pb() },"
done
echo "};"