| Package | Kind | Role |
|---|---|---|
| library | Parses |
|
| library | Provides portable file and directory path utilities | |
| library | Generic, event-driven depth-first directory walker | |
| library | Reads file content and tests it against a compiled regular expression | |
| executable | Application - wires the packages and drives the search |
# 1. Build with Visual Studio # Open TextFinder.sln, select Release x64, press Ctrl+Shift+B # 2. Search the parent directory for C++ files containing "class" TextFinder.exe /P ".." /p "h,cpp" /r "class" # PowerShell / cmd users - the - prefix works equally well TextFinder.exe -P ".." -p "h,cpp" -r "class"
| Option | Argument | Default | Meaning |
|---|---|---|---|
| path | Root directory for the search | ||
| patterns | (all files) | Comma-separated file patterns, e.g. |
|
| regex | Regular expression matched against file content | ||
| Recurse into subdirectories | |||
| Hide directories that contain no matching files | |||
| (flag) | off | Print all resolved options before searching | |
| (flag) | off | Print help and exit |
# Find all C++ header files containing "template" under the current directory TextFinder.exe /P "." /p "h,hpp" /r "template" # Search source and markdown files for a TODO comment, show all directories TextFinder.exe /P "." /p "cpp,h,md" /r "TODO" /H false # Verbose output - shows resolved path, patterns, and regex before searching TextFinder.exe /P ".." /p "h,cpp" /r "virtual" /v
TextFinder ver 2.1.0
=======================
searching path: "../"
patterns: ["h", "cpp"]
matching files with regex: "class"
../TextFinder/src
"TextFinder.h"
"TextFinder.cpp"
../DirExplorerT/src
"DirExplorerT.h"
processed 38 files in 14 dirs
That's all Folks!
void doDir(const std::string& dirPath); void doFile(const std::string& filePath);
# Visual Studio (GUI) Open TextFinder.sln Select configuration: Release | x64 Build > Build Solution (Ctrl+Shift+B) # MSBuild (command line) msbuild TextFinder.sln /p:Configuration=Release /p:Platform=x64
# Unit tests for ProcessCmdLine cd ProcessCmdLine TextFinder.exe /t # runs built-in self-tests with /t flag # Functional smoke test - search this repo for all files with "TextFinder" cd TextFinder\Release TextFinder.exe /P "../../" /p "h,cpp,sln" /r "TextFinder" /v
| Header / Library | Source | Used by | Purpose |
|---|---|---|---|
| C++11 standard library | Compile and match regular expressions | ||
| C++17 standard library | Portable directory iteration and path manipulation |