aboutsummaryrefslogtreecommitdiff
path: root/include/FileUtil.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-04-22 05:58:44 +0200
committerdec05eba <dec05eba@protonmail.com>2018-04-22 05:59:18 +0200
commit1e0e68f9cda51c881b32a54d9eece71c1428f7ac (patch)
treeb8faa1d971c245e3fcf046aa1d2daa1fa601e0f9 /include/FileUtil.hpp
parent424b02609fa34175a4e2aadb95e68b3c9c8dc93c (diff)
Add video and gif support
Gif streams from url. Todo: Add play controls to video
Diffstat (limited to 'include/FileUtil.hpp')
-rw-r--r--include/FileUtil.hpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/FileUtil.hpp b/include/FileUtil.hpp
new file mode 100644
index 0000000..0cfc808
--- /dev/null
+++ b/include/FileUtil.hpp
@@ -0,0 +1,18 @@
+#pragma once
+
+#include "StringView.hpp"
+#include <boost/filesystem/path.hpp>
+#include <stdexcept>
+
+namespace dchat
+{
+ class FileException : public std::runtime_error
+ {
+ public:
+ FileException(const std::string &errMsg) : std::runtime_error(errMsg) {}
+ };
+
+ // Throws FileException on error.
+ // Returned value is allocated with malloc and should be free'd by caller.
+ StringView getFileContent(const boost::filesystem::path &filepath);
+}