Changed ugly xxd to literals.

HPP files are much more readable as multiline literals rather than hex arrays.
This commit is contained in:
JohnnyB 2024-01-30 17:56:21 +00:00 committed by GitHub
parent fea4fd4ba7
commit fd0ad6e521
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,5 +16,12 @@ for FILE in $FILES; do
echo "generate $FILE.hpp"
# use simple flag for old version of xxd
xxd -i $FILE > $DIR/$FILE.hpp
f=$(echo $FILE | sed 's/\./_/g')
echo "const char $f[] = R\"LITERAL(" > $DIR/$FILE.hpp
cat $FILE >> $DIR/$FILE.hpp
echo ")LITERAL\";" >> $DIR/$FILE.hpp
echo "unsigned int ${f}_len = sizeof($f);" >> $DIR/$FILE.hpp
#Deprecated old xxd
#xxd -i $FILE > $DIR/$FILE.hpp
done