Lugdunum  0.1.0
FileHandler.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <fstream>
4 #include <lug/System/Export.hpp>
7 
8 namespace lug {
9 namespace System {
10 namespace Logger {
11 
13 public:
14  // TODO: handle windows's wstring for filenames, had a nasty compiler error and this can be
15  // fixed later
16  FileHandler(const std::string& name, const std::string& filename, bool truncate);
17 
18  FileHandler(const FileHandler&) = delete;
19  FileHandler(FileHandler&&) = delete;
20 
21  FileHandler& operator=(const FileHandler&) = delete;
22  FileHandler& operator=(FileHandler&&) = delete;
23 
24  ~FileHandler();
25 
26  void handle(const priv::Message& msg);
27  void flush();
28 
29 private:
30  std::ofstream _ofs;
31 };
32 
33 } // Logger
34 } // System
35 } // lug
#define LUG_SYSTEM_API
Definition: Export.hpp:11