as_outputbuffer.h 1.8 KB

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