engine.cpp 774 B

123456789101112131415161718192021222324252627282930313233
  1. #include "engine.h"
  2. #include <util/string/cast.h>
  3. #include <util/string/escape.h>
  4. #if !defined(DBGDUMP_INLINE_IF_INCLUDED)
  5. #define DBGDUMP_INLINE_IF_INCLUDED
  6. #endif
  7. DBGDUMP_INLINE_IF_INCLUDED void TDumpBase::String(const TStringBuf& s) {
  8. if (s) {
  9. Raw(TString(s).Quote());
  10. } else {
  11. Raw("(empty)");
  12. }
  13. }
  14. DBGDUMP_INLINE_IF_INCLUDED void TDumpBase::String(const TWtringBuf& s) {
  15. Raw("w");
  16. String(ToString(s));
  17. }
  18. DBGDUMP_INLINE_IF_INCLUDED void TDumpBase::Raw(const TStringBuf& s) {
  19. Stream().Write(s.data(), s.size());
  20. }
  21. DBGDUMP_INLINE_IF_INCLUDED void TDumpBase::Char(char ch) {
  22. Raw("'" + EscapeC(&ch, 1) + "'");
  23. }
  24. DBGDUMP_INLINE_IF_INCLUDED void TDumpBase::Char(wchar16 ch) {
  25. Raw("w'" + ToString(EscapeC(&ch, 1)) + "'");
  26. }