Comment Stripper
This page describes how to use the Comment Stripper program. The source code and executable can be found on the software page.
This program modifies the source files to you programs. You are recommended to backup your source code prior to using this program, or to use the confirm option and the backup option.
Controls
Directory. Specify the directory to be scanned for files to convert. Either type the directory name or use the Windows file dialog.
- Include subdirectories. Select this if you want the converter to convert files that are in subdirectories of the specified directory.
- Make backup. Select this if you want a backup made of each file that is modified. Backups have the .bak extension, so a modified example.cpp will have a backup file of example.cpp.bak.
- C++ (.cpp, .cxx, .cc). Select this if you want to convert C++ code in source files.
- C++ (.hpp, .hxx, .h). Select this if you want to convert C++ code in header files.
- C (.c). Select this if you want to convert C code in source files.
- C (.h). Select this if you want to convert C code in header files.
- Remove multi line comments. Select this if you want to remove multi line comments.
- Confirm changes. Select this if you want to confirm multi line comment removal.
- Remove single line comments. Select this if you want to remove single line comments.
- Confirm changes. Select this if you want to confirm single line comment removal.
- Remove #if 0 blocks. Select this if you want to remove blocks delimited by #if 0 and #endif.
- Confirm changes. Select this if you want to confirm #if 0 block removal.
- Combo box. Use the combo box to select the type of comment removal. Choose from:
- Only strip comments that look like commented out code.
- Only strip comments that look like documentation.
- Strip comment regardless of content.
Scan. Scan the files to find out how many potential changes there are.
Convert. Scan the files and convert the files according to the controls.
Close. Close the program.
When the files are being converted, if the confirm option is enabled a confirmation dialog is displayed. The dialog displays some source code before and after the line to convert to provide context. The line to convert has a ==> symbol at the start of the line.
- Replace. Replace the quotes with _T(""), move to the next change.
- Don't Replace. Move to the next change without replacing the quotes.
- Replace All In File. Replace all the remaining quotes with _T(""), then move to the next file.
- Don't Replace Any In File. Move to the next file without making any more changes in this file.
- Replace In All Files. Replace all the remaining quotes with _T("") in this file and all remaining files.
- Don't Replace In Any File. Stop replacing quotes in this file. Do not make changes in any more files.
As always with programs that modify source code, backup your work before proceeding. Object Media will not be held responsible for any loss incurred by using this program. You use this program at your own risk.

