forked from boostorg/beast
Add field enumeration
This commit is contained in:
1 parent
f3bec70e65
commit
1c063f5bf6
10 files changed
+1481
No files matched your search
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
export LC_COLLATE=C
|
||||
|
||||
echo "// string constants"
|
||||
echo ' "<unknown-field>",'
|
||||
cat $1 | uniq | sort -f | sed 's/^/ \"/; s/$/\",/'
|
||||
echo
|
||||
|
||||
echo "enum class field : unsigned short"
|
||||
echo "{"
|
||||
echo " unknown = 0,"
|
||||
echo
|
||||
#cat $1 | uniq | sort -f | sed 's/./\L&/g; s/^/\t/; s/$/,/'
|
||||
cat $1 | uniq | sort -f | sed 's/\(.*\)/ \L\1,/; s/-/_/g'
|
||||
echo "};"
|
||||
echo
|
||||
|
||||
echo "// pairs"
|
||||
#cat $1 | uniq | sort -f | sed 's/\(.*\)/\tmatch\(field::\L\1, \"\E\1\"\);/; s/-/_/'
|
||||
cat $1 | uniq | sort -f | perl -nE 'chomp; $a=lc($_); $a=~s/-/_/g; say " match(field::$a, \"$_\");";' | tr -d "\015"
|
||||
|
||||
Reference in new issue
Block a user