假设我有很多要向其中添加名称空间声明的c ++文件。即我希望文件看起来像:
//pre-processor commands and other stuff not in the namespace
namespace foo
{
//previously existing code
}
//EOF
Run Code Online (Sandbox Code Playgroud)
有什么方法可以不必手动打开每个文件?到目前为止,我能想到的最好的是一个emacs宏来对每个文件进行处理,但是我仍然必须遍历每个文件。