ScummVM API documentation
as_outputbuffer.h
1 /*
2  AngelCode Scripting Library
3  Copyright (c) 2003-2023 Andreas Jonsson
4 
5  This software is provided 'as-is', without any express or implied
6  warranty. In no event will the authors be held liable for any
7  damages arising from the use of this software.
8 
9  Permission is granted to anyone to use this software for any
10  purpose, including commercial applications, and to alter it and
11  redistribute it freely, subject to the following restrictions:
12 
13  1. The origin of this software must not be misrepresented; you
14  must not claim that you wrote the original software. If you use
15  this software in a product, an acknowledgment in the product
16  documentation would be appreciated but is not required.
17 
18  2. Altered source versions must be plainly marked as such, and
19  must not be misrepresented as being the original software.
20 
21  3. This notice may not be removed or altered from any source
22  distribution.
23 
24  The original version of this library can be located at:
25  http://www.angelcode.com/angelscript/
26 
27  Andreas Jonsson
28  andreas@angelcode.com
29 */
30 
31 
32 //
33 // as_outputbuffer.h
34 //
35 // This class appends strings to one large buffer that can later
36 // be sent to the real output stream
37 //
38 
39 
40 #ifndef AS_OUTPUTBUFFER_H
41 #define AS_OUTPUTBUFFER_H
42 
43 #include "as_config.h"
44 
45 #ifndef AS_NO_COMPILER
46 
47 #include "as_string.h"
48 #include "as_memory.h"
49 
50 BEGIN_AS_NAMESPACE
51 
53 class asCScriptEngine;
54 
56 public:
57  ~asCOutputBuffer();
58  void Clear();
59  void Callback(asSMessageInfo *msg);
60  static void CDeclCallback(asSMessageInfo* msg, asCOutputBuffer* buf) { buf->Callback(msg); }
61  void Append(asCOutputBuffer &in);
62  void SendToCallback(asCScriptEngine *engine, asSSystemFunctionInterface *func, void *obj);
63 
64  struct message_t {
65  asCString section;
66  int row;
67  int col;
68  asEMsgType type;
69  asCString msg;
70  };
71 
72  asCArray<message_t *> messages;
73 };
74 
75 END_AS_NAMESPACE
76 
77 #endif // AS_NO_COMPILER
78 
79 #endif
Definition: as_outputbuffer.h:55
Definition: as_outputbuffer.h:64
Definition: as_array.h:47
Definition: as_callfunc.h:99
Definition: angelscript.h:502
Definition: as_scriptengine.h:64
Definition: as_string.h:41