Cafu Engine
ConsoleStdout.hpp
1 /*
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.
5 */
6 
7 #ifndef CAFU_CONSOLE_STDOUT_HPP_INCLUDED
8 #define CAFU_CONSOLE_STDOUT_HPP_INCLUDED
9 
10 #include "Console.hpp"
11 
12 
13 namespace cf
14 {
15  /// This class implements the ConsoleI interface by printing the console output to stdout.
16  class ConsoleStdoutT : public ConsoleI
17  {
18  public:
19 
20  /// Constructor for creating an instance of a ConsoleStdoutT.
21  /// @param AutoFlush_ Whether auto-flushing is enabled or not.
22  ConsoleStdoutT(bool AutoFlush_=false);
23 
24  /// Enables or diables auto-flushing.
25  /// If enabled, each call to the ConsoleI output functions is followed by a flush of the stdout stream.
26  void EnableAutoFlush(bool AutoFlush_);
27 
28  /// Flushes the stdout stream.
29  void Flush();
30 
31  // Methods of the ConsoleI interface.
32  void Print(const std::string& s);
33  void DevPrint(const std::string& s);
34  void Warning(const std::string& s);
35  void DevWarning(const std::string& s);
36 
37 
38  private:
39 
40  bool AutoFlush; ///< Whether auto-flushing is enabled or not.
41  };
42 }
43 
44 #endif
ConsoleStdoutT(bool AutoFlush_=false)
Constructor for creating an instance of a ConsoleStdoutT.
Definition: ConsoleStdout.cpp:13
void EnableAutoFlush(bool AutoFlush_)
Enables or diables auto-flushing.
Definition: ConsoleStdout.cpp:19
void DevPrint(const std::string &s)
Print dev message to console.
Definition: ConsoleStdout.cpp:39
void Warning(const std::string &s)
Print warning to console.
Definition: ConsoleStdout.cpp:47
void Flush()
Flushes the stdout stream.
Definition: ConsoleStdout.cpp:25
This class implements the ConsoleI interface by printing the console output to stdout.
Definition: ConsoleStdout.hpp:16
This class is an interface to the application console.
Definition: Console.hpp:18
void DevWarning(const std::string &s)
Print dev warning to console.
Definition: ConsoleStdout.cpp:55
void Print(const std::string &s)
Print message to console.
Definition: ConsoleStdout.cpp:31