ScummVM API documentation
output_handler.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 //=============================================================================
23 //
24 // IOutputHandler is a debug printing interface. Its implementations can be
25 // registered as potential output for the debug log.
26 //
27 //=============================================================================
28 
29 #ifndef AGS_SHARED_CORE_DEBUGGING_OUTPUT_HANDLER_H
30 #define AGS_SHARED_CORE_DEBUGGING_OUTPUT_HANDLER_H
31 
32 #include "ags/shared/debugging/out.h"
33 #include "ags/shared/util/string.h"
34 
35 namespace AGS3 {
36 namespace AGS {
37 namespace Shared {
38 
39 struct DebugMessage {
40  String Text;
41  uint32_t GroupID;
42  String GroupName;
43  MessageType MT;
44 
45  DebugMessage() : GroupID((uint32_t)kDbgGroup_None), MT(kDbgMsg_None) {
46  }
47  DebugMessage(const String &text, uint32_t group_id, const String &group_name, MessageType mt)
48  : Text(text)
49  , GroupID(group_id)
50  , GroupName(group_name)
51  , MT(mt) {
52  }
53 };
54 
56 public:
57  virtual ~IOutputHandler() {}
58 
59  // Print the given text sent from the debug group.
60  // Implementations are free to decide which message components are to be printed, and how.
61  virtual void PrintMessage(const DebugMessage &msg) = 0;
62 };
63 
64 } // namespace Shared
65 } // namespace AGS
66 } // namespace AGS3
67 
68 #endif
Definition: achievements_tables.h:27
Definition: output_handler.h:39
Definition: string.h:62
Definition: output_handler.h:55
Definition: ags.h:40