aboutsummaryrefslogtreecommitdiff
path: root/src/utility.h
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-10-18 17:35:11 +0200
committerAdrian Kummerlaender2015-10-18 17:35:11 +0200
commit68b69dfc92daffbe52b4eb7eb317beb2cc764fb0 (patch)
tree1748b69328c78c80fbf327911542bec6d75f73f2 /src/utility.h
parent6a66bd864b9b95258a198e65849fa693f88032aa (diff)
downloadchange-68b69dfc92daffbe52b4eb7eb317beb2cc764fb0.tar
change-68b69dfc92daffbe52b4eb7eb317beb2cc764fb0.tar.gz
change-68b69dfc92daffbe52b4eb7eb317beb2cc764fb0.tar.bz2
change-68b69dfc92daffbe52b4eb7eb317beb2cc764fb0.tar.lz
change-68b69dfc92daffbe52b4eb7eb317beb2cc764fb0.tar.xz
change-68b69dfc92daffbe52b4eb7eb317beb2cc764fb0.tar.zst
change-68b69dfc92daffbe52b4eb7eb317beb2cc764fb0.zip
Add cmake build instructions
Diffstat (limited to 'src/utility.h')
-rw-r--r--src/utility.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/utility.h b/src/utility.h
new file mode 100644
index 0000000..27ce8e9
--- /dev/null
+++ b/src/utility.h
@@ -0,0 +1,28 @@
+#ifndef CHANGE_UTILITY_H_
+#define CHANGE_UTILITY_H_
+
+#include <ext/stdio_filebuf.h>
+
+#include <iostream>
+
+namespace utility {
+
+class Logger {
+ public:
+ Logger(const int target_fd):
+ buffer(target_fd, std::ios::out),
+ stream(&this->buffer) { }
+
+ void append(const std::string& msg) {
+ this->stream << msg << std::endl;
+ }
+
+ private:
+ __gnu_cxx::stdio_filebuf<char> buffer;
+ std::ostream stream;
+
+};
+
+}
+
+#endif // CHANGE_UTILITY_H_