mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -04:00
36 lines
778 B
Bash
Executable File
36 lines
778 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# GNU prefix command for mac os support (gsed, gsplit)
|
|
GP=
|
|
if [[ "$OSTYPE" =~ darwin* ]]; then
|
|
GP=g
|
|
fi
|
|
|
|
for file in $*; do
|
|
d=${file#*/}
|
|
d=${d%/*}
|
|
f=${file##*/}
|
|
f=${f%.*}
|
|
|
|
tempfile=$(${GP}mktemp ${f}XXXX --suffix=.h)
|
|
|
|
# Remove comments
|
|
${GP}sed 's/a/aA/g;s/__/aB/g;s/#/aC/g' "src/$d/$f.h" | cpp -E $arg - | ${GP}sed 's/aC/#/g;s/aB/__/g;s/aA/a/g' > $tempfile
|
|
|
|
# Remove override keyword
|
|
${GP}sed -i 's/ override;/;/g' $tempfile
|
|
|
|
# Remove preprocessor directives
|
|
${GP}sed -i '/^#/d' $tempfile
|
|
|
|
# Remove CORE_EXPORT etc
|
|
${GP}sed -i 's/ [A-Z]*_EXPORT//g' $tempfile
|
|
|
|
# Remove public keyword from inherited classes
|
|
${GP}sed -i 's/\(class.*:\) public\(.*\)/\1\2/g' $tempfile
|
|
|
|
vimdiff $tempfile python/$d/$f.sip
|
|
|
|
rm $tempfile
|
|
done
|