2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
7 #ifndef CAFU_CONSOLE_FILE_HPP_INCLUDED
8 #define CAFU_CONSOLE_FILE_HPP_INCLUDED
10 #include "Console.hpp"
17 /// This class implements the ConsoleI interface by writing the console output into a text file.
18 class ConsoleFileT
: public ConsoleI
22 /// Constructor for creating an instance of a ConsoleFileT.
23 /// @param FileName Path and name of the file that the console output is to be written to.
24 ConsoleFileT(const std::string
& FileName
);
26 /// Sets if the console buffer should be auto-flushed after each call to one of the Print() or Warning() methods.
27 void SetAutoFlush(bool AutoFlush
) { m_AutoFlush
=AutoFlush
; }
29 /// Flushes the buffers so that all contents is immediately written into the file.
32 // Methods of the ConsoleI interface.
33 void Print(const std::string
& s
);
34 void DevPrint(const std::string
& s
);
35 void Warning(const std::string
& s
);
36 void DevWarning(const std::string
& s
);
41 std::ofstream m_File
; ///< The filestream output is logged to.
42 bool m_AutoFlush
; ///< If the console buffer should be auto-flushed after each call to one of the Print() or Warning() methods.