summaryrefslogtreecommitdiff
path: root/examples/server/deps.sh
diff options
context:
space:
mode:
authorJohnnyB <jboero@users.noreply.github.com>2024-01-30 12:15:05 -0600
committerGitHub <noreply@github.com>2024-01-30 20:15:05 +0200
commit4003be0e5feef320f3707786f22722b73cff9356 (patch)
tree5da952c3a524db134f7ec8fefc534a880c28f927 /examples/server/deps.sh
parentfea4fd4ba7f6b754ac795387b275e1a014a77bde (diff)
server : change deps.sh xxd files to string literals (#5221)
* Changed ugly xxd to literals. HPP files are much more readable as multiline literals rather than hex arrays. * Dashes in literal variable names. Replace . and - with _ in file names -> variable names. * Comment on removing xxd. XXD-> string literals * XXD to string literals. Replaced these unreadable headers with string literal versions using new deps.sh.
Diffstat (limited to 'examples/server/deps.sh')
-rwxr-xr-xexamples/server/deps.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/examples/server/deps.sh b/examples/server/deps.sh
index ea23e645..c0a9de9f 100755
--- a/examples/server/deps.sh
+++ b/examples/server/deps.sh
@@ -15,6 +15,13 @@ cd $PUBLIC
for FILE in $FILES; do
echo "generate $FILE.hpp"
- # use simple flag for old version of xxd
- xxd -i $FILE > $DIR/$FILE.hpp
+ # Use C++11 string literals instead of ugly xxd.
+ f=$(echo $FILE | sed 's/\./_/g' -e '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