treeScannerC/README.md

163 lines
5.6 KiB
Markdown
Raw Normal View History

2025-05-09 22:46:31 +02:00
# ⚙️ CLI-Template für C (MSVC)
![TreeScanner-Logo](./media/logo-alpha-512x512.png)
2025-05-09 22:46:31 +02:00
Ein leichtgewichtiges C-Projekttemplate für die Kommandozeile unter Windows, vorbereitet für den Microsoft Visual C Compiler (MSVC).
## Inhalt
- [⚙️ CLI-Template für C (MSVC)](#-cli-template-für-c-msvc)
- [Inhalt](#inhalt)
- [Features](#features)
- [Struktur](#struktur)
- [Voraussetzungen](#voraussetzungen)
- [Compiler (MSVC)](#compiler-msvc)
- [Make (empfohlen: MSYS2)](#make-empfohlen-msys2)
2025-05-09 22:46:31 +02:00
- [Nutzung](#nutzung)
- [Build](#build)
- [Optionen](#optionen)
2025-05-09 22:46:31 +02:00
- [Dokumentation](#dokumentation)
- [Plattformhinweis](#plattformhinweis)
- [Geplante Features](#geplante-features)
- [Lizenz](#lizenz)
2025-05-09 22:46:31 +02:00
---
## Features
- Rekursive Verzeichnissuche mit Unicode-Symbolen (📁 📄)
- Optionale Tiefenbegrenzung via `--depth N`
- Limitierung der Dateiausgabe pro Verzeichnis via `--limit N`
- Unicode-fähige Konsolenausgabe auf Windows (`SetConsoleOutputCP`)
- Debugging vorbereitet via `launch.json` (VS Code)
- Sauber modularisierter Code (main + Module + Config)
- MSVC-kompatibles Buildsystem (`cl.exe` + `rc.exe` + `link.exe`)
- Unterstützt `Makefile` + `Makefile.config` für Debug/Release
2025-05-09 22:46:31 +02:00
[](#inhalt)
---
## Struktur
Alle notwendigen Verzeichnisse und Dateien wurden mit ✅ markiert, diese sind unverzichtbar für den Buildprozess.
❌ markiert alles, was optional ist oder ignoriert werden kann.
2025-05-09 22:46:31 +02:00
```plaintext
📁 treescanner
📁 .vscode # ❌ VS Code-Konfiguration (Debug, Build, Editor-Style)
📄 launch.json # ❌ Debug-Konfiguration (z.B. scanner.exe + Breakpoints)
📄 tasks.json # ❌ Build-Task für Make unter Windows
📁 build # ✅ Buildverzeichnis
📁 output # ✅ Kompilierte .exe und .obj-Dateien
📁 include # ✅ Header-Dateien
📄 app.h # ✅ Schnittstelle für scan_directory()
📄 scanner_config.h # ✅ Konfiguration für Tiefen-/Limitsteuerung
📁 resources # ✅ Ressourcen wie version.rc
📄 version.rc # ✅ Icon- und Versionsdefinition
📁 src # ✅ Quellcode (.c-Dateien)
📄 main.c # ✅ Einstiegspunkt mit Argumentverarbeitung
📄 app.c # ✅ rekursiver Verzeichnisscan (Windows API)
📄 scanner_config.c # ✅ Initialisierung und Verwaltung der Konfiguration
📄 build.cmd # ✅ Buildskript (ruft `vcvars64.bat` und `make` auf)
📄 clean.cmd # ✅ Löscht `/build/output` + ggf. `.pdb`
📄 README.md # ❌ Diese Datei
📄 .gitignore # ❌ Ignoriert z.B. *.obj, *.pdb, /build/
2025-05-09 22:46:31 +02:00
```
[](#inhalt)
---
## Voraussetzungen
### Compiler (MSVC)
2025-05-09 22:46:31 +02:00
- [Visual Studio Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/)
- Umgebung wird über `vcvars64.bat` gesetzt
2025-05-09 22:46:31 +02:00
### Make (empfohlen: MSYS2)
- [x] `make` aus MSYS2 installieren: `pacman -S make`
2025-05-09 22:46:31 +02:00
[](#inhalt)
---
## Nutzung
### Build
2025-05-09 22:46:31 +02:00
```cmd
build.cmd
```
→ erzeugt `build/output/scanner.exe`
### Optionen
```cmd
scanner.exe [verzeichnis] [--depth N] [--limit N]
```
Beispiele:
```cmd
scanner.exe
scanner.exe "D:\Projekte" --depth 3
scanner.exe . --limit 5
```
2025-05-09 22:46:31 +02:00
[](#inhalt)
---
## Dokumentation
- [x] [Code Style Guide (C für CLI-Projekte)](./doc/code_style.md)
- [x] [Windows API Referenz](./doc/index.md)
2025-05-09 22:46:31 +02:00
[](#inhalt)
---
## Plattformhinweis
> Aktuell ausschließlich für **Windows** (MSVC / WinAPI) vorgesehen.
> POSIX-Implementierung (`opendir`, `readdir`) ist vorbereitet aber nicht aktiv.
[](#inhalt)
---
## Geplante Features
| Funktion / Option | Beschreibung | Status |
| -------------------------- | --------------------------------------------------------------- | ------------- |
| `--depth N` | Maximale Verzeichnistiefe | ✅ Fertig |
| `--limit N` | Max. Dateien pro Verzeichnis | ✅ Fertig |
| `--ignore DIR` | Verzeichnisse ausschließen | ⬜ Geplant |
| `--output FILE` | Ausgabedatei (Standard: `tree.md`) mit `plaintext`-Block | ⬜ Geplant |
| ASCII-Baumstruktur (`├──`) | grafische Darstellung mit Baumzeichen → **Standardmäßig aktiv** | ⬜ Geplant |
| `--no-tree-symbols` | Option zum Deaktivieren der Baumzeichensymbole | ⬜ Geplant |
| `--console` | explizite Konsolenausgabe einschalten | ⬜ Geplant |
| `--align-comments` | Ausrichtung von Kommentaren in Spalte | ⬜ Geplant |
| `--language de/en` | Sprache der Ausgaben und Zusammenfassung | ⬜ Geplant |
| Scan-Zusammenfassung | Ausgabe: `📦 23 Dateien in 5 Ordnern`, ggf. mit Pfad | ⬜ Geplant |
| Fortschrittsanzeige | Zeitgesteuerte Live-Ausgabe | ⬜ Optional |
| POSIX-Kompatibilität | Unterstützung für Linux (`opendir`, `readdir`) | ⬜ Vorbereitet |
| Symbol-Set anpassbar | Benutzerdefinierte Icons (📁, 📄 etc.) | ⬜ Optional |
| Laufzeit erfassen | Zu Benchmarkzwecken Durchlaufzeit erfassen von Start bis Ende | ✅ Fertig |
[](#inhalt)
---
## Lizenz
MIT siehe Datei [LICENSE](./LICENSE)
2025-05-09 22:46:31 +02:00
[](#inhalt)
---