aboutsummaryrefslogtreecommitdiff
path: root/include/filehandler.h
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2025-06-10 22:52:21 +0530
committerRaghuram Subramani <raghus2247@gmail.com>2025-06-10 22:52:21 +0530
commit5f7deaa1944016f56d2ac3cba08ca702033dbe7e (patch)
tree075465f7872fd07035686cdf1f59a0ab8c9658c1 /include/filehandler.h
parentefafc900db790cac808e0fc6722272bdec451e73 (diff)
Revert "C++->C"
This reverts commit efafc900db790cac808e0fc6722272bdec451e73.
Diffstat (limited to 'include/filehandler.h')
-rw-r--r--include/filehandler.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/include/filehandler.h b/include/filehandler.h
index bf52e2c..ac8fa88 100644
--- a/include/filehandler.h
+++ b/include/filehandler.h
@@ -2,18 +2,23 @@
#define __FILEHANDLER_H
#include <stdbool.h>
-#include <stddef.h>
#include <stdio.h>
-typedef struct {
+class Filehandler
+{
+private:
FILE *f;
char *path;
char *buffer;
-} filehandler_t;
-void filehandler_init(filehandler_t *fh, char *path);
-bool filehandler_open(filehandler_t *fh);
-char *filehandler_read(filehandler_t *fh);
-void filehandler_close(filehandler_t *fh);
+private:
+ unsigned int size(void);
+
+public:
+ Filehandler(char *path);
+ bool open(void);
+ char *read(void);
+ void close(void);
+};
#endif