📄 chgnames.sh
字号:
#!/bin/sh## This is a script for changing method names## The process is the following:## 1. Do some replacements as shown below.# If an accessor name was used for both get and set, use sed# to replace the get method.# If a name is fairly general, restrict to those that begin# with ' ' \. > ( \t # 2. Change any get* methods in a class that are really set* methods# to the correct name in .h and .cpp files.# 3. Compile and find errors. This step helps correct # 4. If your replacements mess you up, then check out a new distribution# and start over.# 5. If the project compiled, then commit.# Class to use to take care of names that might# be inside another nameecho > sedcmdschgredun(){ echo 's/ '"$1/ $2/"'g' >> sedcmds echo 's/\.'"$1/\.$2/"'g' >> sedcmds echo 's/:'"$1/:$2/"'g' >> sedcmds echo 's/>'"$1/>$2/"'g' >> sedcmds echo 's/('"$1/($2/"'g' >> sedcmds echo 's/'" $1/ $2/"'g' >> sedcmds}# Write out name pairs to a filechgredun ConstructTxDataSet setupTxDataSet# Needs hand work# Change names inside the filesfor j in txac txan txid txnld txacan txgc txmapabase gui; do cd $j files=`ls *.h *.cpp *.cxx` for i in $files; do sed -f ../sedcmds <$i >$i.new dfff=`diff $i $i.new` if test -n "$dfff"; then rm -f $i.orig mv $i $i.orig mv $i.new $i else rm $i.new : fi done cd ..done
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -