kuvshinovdr / srcstats

A small console program to gather and report C++ source files statistics.
MIT License
1 stars 1 forks source link

srcstats

A small console program to gather and report C++ source files statistics. This program emerged as an educational example for my C++ lessons.

ISO C++23.

Command line parameters may be directory or file paths or --help for minimal help/about message. The program reports statistics over all header files and source files separately and in total as is and after decommenting and removing empty lines and whitespace line endings. Errors are reported to stderr.

Files are considered to be provided in ASCII encoding (or compatible 8-bit encoding, not UTF-8 currently).

Change log

Version 0.6: Better support for adding input programming languages.

Version 0.5: Refactored to ease adding of several input programming languages support.

Version 0.4: Complete refactoring. Separate file/line statistics and raw/decommented source files statistics. The source code is now split into several header and source files, its total volume is threefold of the version 0.3.

Version 0.3: Now exceptions are reported and the program should not just silently fall down. Function file_to_string does not print messages to clog anymore reporting errors via File_error exception.

Version 0.2: Speed-up: reads files into strings as a whole then processes them. CRLF vs LF: removes all CR characters in ahead. New feature: reports time elapsed.

Version 0.1: The simplest version. Reads files using std::getline, ignores CRLF vs LF, ignores UTF encodings, ignores possible filesystem exceptions.