aboutsummaryrefslogtreecommitdiff
path: root/src/Conf.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2017-12-08 00:49:15 +0100
committerdec05eba <dec05eba@protonmail.com>2017-12-08 00:50:04 +0100
commitbf24f6fc48b4eebb06cdcd7029d1d31d4c6028dd (patch)
treeb9cb68dc44e002586a1e09aeb60bb42f75258758 /src/Conf.cpp
parent3fc89b69ff3fc937a0cde32c2fae9ce3b3cf1ebc (diff)
Added loading of project file and file validations
Next up: parse project.conf file
Diffstat (limited to 'src/Conf.cpp')
-rw-r--r--src/Conf.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Conf.cpp b/src/Conf.cpp
new file mode 100644
index 0000000..d535c60
--- /dev/null
+++ b/src/Conf.cpp
@@ -0,0 +1,18 @@
+#include "../include/Conf.hpp"
+#include "../include/FileUtil.hpp"
+
+using namespace std;
+
+namespace sibs
+{
+ Result<string> readConf(const char *filepath)
+ {
+ Result<string> fileContentResult = getFileContent(filepath);
+ if(fileContentResult.isErr())
+ return fileContentResult;
+
+ string configData;
+ printf("file content:\n%s\n", fileContentResult.unwrap().c_str());
+ return Result<string>::Ok(std::move(configData));
+ }
+} \ No newline at end of file