From f07bec25f89e79c4f0fa976fc96640766ea61801 Mon Sep 17 00:00:00 2001 From: unai_71 Date: Tue, 10 Mar 2026 16:33:08 +0000 Subject: [PATCH] feat: updated readme --- README.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 017861e..8c289fb 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,16 @@ A Test-Driven Development (TDD) workflow was followed throughout the project. Ev ## SysfsRead class -- Will convert the contents of a file and output an enum class -- Reads a sysfs-like file -- If the file is missing, the reader will output Unreachable -- If the file contains only a "1" the reader will output Enabled -- If the file contains "error: temp too high", the reader will output ErrorTempTooHigh -- if the file contains any other value the reader will output UnexpectedValue -- if the file is empty: it will output Empty +`SysfsReader` ([include/SysfsRead.hpp](include/SysfsRead.hpp), [src/core/SysfsRead.cxx](src/core/SysfsRead.cxx)) is the lowest-level component. It opens a sysfs-like file and translates its raw text content into a `SysfsStatus` enum: +| File content | Status | +|--------------------------|---------------------| +| `"1"` | `Enabled` | +| `"error: temp too high"` | `ErrorTempTooHigh` | +| empty / whitespace-only | `Empty` | +| file missing | `Unreachable` | +| anything else | `UnexpectedValue` | + +The reader never throws on I/O errors; every outcome is expressed through the enum so callers can react without exception handling. A helper `trim_in_place` strips trailing whitespace and newlines before comparison. + +**Tests:** [tests/test_sysfs_read.cxx](tests/test_sysfs_read.cxx) — covers all five status branches by writing controlled content to a temporary file.