diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-12 11:34:54 +0800 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-12 11:34:54 +0800 |
| commit | 70ff2908167db12ddfb319e5e3dcfcf50ecb886d (patch) | |
| tree | 4ff2053b5f6d0f78d9c13764b2ae15621a0c1a2c /include | |
| parent | 77cd5981b398075ff866aab9d4145fc28542d773 (diff) | |
adapt RAII unix file
Diffstat (limited to 'include')
| -rw-r--r-- | include/util/file.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/util/file.h b/include/util/file.h index bbc6539..fb92a9e 100644 --- a/include/util/file.h +++ b/include/util/file.h @@ -14,6 +14,10 @@ class T_unix_file_d; class T_unix_file_p; +/* + * RAII unix file descriptor + * fd is automatically closed with RAII + */ class T_unix_file_d { public: @@ -51,6 +55,11 @@ public: T_unix_file_d &operator=(const T_unix_file_d &) = delete; }; + +/* + * RAII FILE pointer + * FILE* is automatically closed with RAII + */ class T_unix_file_p : public T_unix_file_d { public: |
