Swap cpp and h files

DrScript
2004-08-09
2004-08-09
  • Hello,

    a small script to toggle between header and cpp
    file.
    replace the -> with tab character.
    paste into drPython. call replace "->" with special
    char '\t' tab. This should be all.

    #drscript
    newext=""
    if os.path.splitext(DrFilename)[1].lower() == ".cpp":
    ->newext = ".h"
    elif os.path.splitext(DrFilename)[1].lower() == ".h":
    ->newext = ".cpp"
    if newext != "":
    ->newfile = os.path.splitext(DrFilename)[0] + newext
    ->alreadyopen = map(lambda x: x.filename, DrFrame.txtDocumentArray)
    ->if newfile in alreadyopen:
    ->->DrFrame.setDocumentTo(alreadyopen.index(newfile))
    ->else:
    ->->DrFrame.OpenFile(newfile, True)