Cafu Engine
ConsoleStringBuffer.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_STRINGBUFFER_HPP_INCLUDED
8 #define CAFU_CONSOLE_STRINGBUFFER_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.
17  {
18  public:
19 
20  /// Constructor for creating an instance of a ConsoleStringBufferT.
22 
23  /// Returns the (contents of the) buffer.
24  /// @returns the (contents of the) buffer.
25  const std::string& GetBuffer() const;
26 
27  /// Clears (empties) the buffer.
28  void ClearBuffer();
29 
30  // Methods of the ConsoleI interface.
31  void Print(const std::string& s);
32  void DevPrint(const std::string& s);
33  void Warning(const std::string& s);
34  void DevWarning(const std::string& s);
35 
36 
37  private:
38 
39  std::string Buffer; ///< The string where we buffer all output.
40  };
41 }
42 
43 #endif
void Warning(const std::string &s)
Print warning to console.
Definition: ConsoleStringBuffer.cpp:43
ConsoleStringBufferT()
Constructor for creating an instance of a ConsoleStringBufferT.
Definition: ConsoleStringBuffer.cpp:12
void DevWarning(const std::string &s)
Print dev warning to console.
Definition: ConsoleStringBuffer.cpp:50
This class is an interface to the application console.
Definition: Console.hpp:18
void DevPrint(const std::string &s)
Print dev message to console.
Definition: ConsoleStringBuffer.cpp:36
const std::string & GetBuffer() const
Returns the (contents of the) buffer.
Definition: ConsoleStringBuffer.cpp:18
void ClearBuffer()
Clears (empties) the buffer.
Definition: ConsoleStringBuffer.cpp:24
void Print(const std::string &s)
Print message to console.
Definition: ConsoleStringBuffer.cpp:30
This class implements the ConsoleI interface by printing the console output to stdout.
Definition: ConsoleStringBuffer.hpp:16