Created
September 11, 2012 23:25
-
-
Save bastih/3702969 to your computer and use it in GitHub Desktop.
Slightly scary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set +H | |
path=`find src/ -type f` | |
ssed -i "s/using namespace std;//" $path; | |
ssed -i "s/using std::.*//" $path; | |
# std-ize templates | |
for symbol in stack map list vector queue set pair priority_queue make_shared dynamic_pointer_cast numeric_limits back_insert_iterator | |
do | |
echo $symbol; | |
ssed -i -R "s/(?<![>\._A-Za-z])(?<!::)(?<! <)(?<!\/)$symbol(?=<)/std::$symbol/g" $path; | |
done | |
# std-ize symbols | |
for symbol in istream ifstream ostream ofstream stringstream cin cout dec hex endl flush _S_failbit runtime_error string less equal_to logical_and transform ios exception | |
do | |
echo $symbol; | |
ssed -i -R "s/(?<![>\._A-Za-z])(?<!::)(?<!include <)(?<!\/)$symbol(?![_A-Za-z])/std::$symbol/g" $path; | |
done | |
# std-ize functions/constructors | |
for symbol in runtime_error max setprecision exception | |
do | |
echo $symbol; | |
ssed -i -R "s/(?<![>\._A-Za-z])(?<!::)(?<! <)(?<!\/)$symbol(?=\()/std::$symbol/g" $path; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment