LogToStringArray.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // David Eberly, Geometric Tools, Redmond WA 98052
  2. // Copyright (c) 1998-2020
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // https://www.boost.org/LICENSE_1_0.txt
  5. // https://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
  6. // Version: 4.0.2019.08.13
  7. #pragma once
  8. #include <Mathematics/Logger.h>
  9. #include <vector>
  10. namespace WwiseGTE
  11. {
  12. class LogToStringArray : public Logger::Listener
  13. {
  14. public:
  15. LogToStringArray(std::string const& name, int flags)
  16. :
  17. Logger::Listener(flags),
  18. mName(name)
  19. {
  20. }
  21. inline std::string const& GetName() const
  22. {
  23. return mName;
  24. }
  25. inline std::vector<std::string> const& GetMessages() const
  26. {
  27. return mMessages;
  28. }
  29. inline std::vector<std::string>& GetMessages()
  30. {
  31. return mMessages;
  32. }
  33. private:
  34. virtual void Report(std::string const& message)
  35. {
  36. mMessages.push_back(message);
  37. }
  38. std::string mName;
  39. std::vector<std::string> mMessages;
  40. };
  41. }