Sourcecode header

Download SrcHead 1.1

SrcHead is a free utility that can adjust the header of multiple sourcefiles. It
is written for Windows and needs the .NET Framework 2.0 to work.

It is a command-line utility, and it’s syntax is: SrcHead.exe <directory>

SrcHead uses a configuration file SrcHead.config. A configuration file is also
delivered with this download. This configuration file has the
following sections:

  • headerpath: contains a path to the textfile with the header definition;
  • filetypes: defines all file-extension that are considered sourcefiles. For each
    extension the comment-token is given;
  • exclude: defines all file-extensions that must be excluded from being adjusted;
  • macro: defines all user-macro’s that can be used in the header, and are automatically
    replaced.

The following standard macro’s are available:

  • FILENAME: Inserts or updates the filename of the sourcefile;
  • AUTOINCREMENT: Inserts the number 1, or increments an existing number by 1;
  • CREATIONDATE: Inserts the creation date, or leaves an existing value;
  • EDITDATE: Inserts or updates the edit date.

When run, all sourcefiles in the directory and subdirectories that are not read-only
are processed. The header is inserted or updated, by using the values in the configuration
file, the properties of the sourcefile, and the existing header.

The header can contain any text. Commenttokens should not be used, since they are
automatically inserted by the application. A macro can be inserted at the end of
a line, by using the symbol ‘{‘. After the macro, the line must end. See
the example header.txt file delivered with the download.