treeScannerC/README.md
Adam Skotarczak fc219ceac1
feature/max abgeschlossen
- Verzeichnistiefe und maximale Anzahl an Dateien über Parameter steuerbar
 - weitere Features implementiert wie Laufzeitmessung
2025-05-14 22:34:13 +02:00

163 lines
5.6 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ⚙️ CLI-Template für C (MSVC)
![TreeScanner-Logo](./media/logo-alpha-512x512.png)
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)
- [Nutzung](#nutzung)
- [Build](#build)
- [Optionen](#optionen)
- [Dokumentation](#dokumentation)
- [Plattformhinweis](#plattformhinweis)
- [Geplante Features](#geplante-features)
- [Lizenz](#lizenz)
---
## 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
[](#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.
```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/
```
[](#inhalt)
---
## Voraussetzungen
### Compiler (MSVC)
- [Visual Studio Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/)
- Umgebung wird über `vcvars64.bat` gesetzt
### Make (empfohlen: MSYS2)
- [x] `make` aus MSYS2 installieren: `pacman -S make`
[](#inhalt)
---
## Nutzung
### Build
```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
```
[](#inhalt)
---
## Dokumentation
- [x] [Code Style Guide (C für CLI-Projekte)](./doc/code_style.md)
- [x] [Windows API Referenz](./doc/index.md)
[](#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)
[](#inhalt)
---