#pragma once #include "engine.h" #include #include #include //smart pointers template struct TDumper> { template static inline void Dump(S& s, const TAutoPtr& v) { s << DumpRaw("TAutoPtr(") << v.Get() << DumpRaw(")"); } }; template struct TDumper> { template static inline void Dump(S& s, const THolder& v) { s << DumpRaw("THolder(") << v.Get() << DumpRaw(")"); } }; template struct TDumper> { template static inline void Dump(S& s, const TIntrusivePtr& v) { s << DumpRaw("TIntrusivePtr(") << v.Get() << DumpRaw(")"); } }; template struct TDumper> { template static inline void Dump(S& s, const TSharedPtr& v) { s << DumpRaw("TSharedPtr(") << v.Get() << DumpRaw(")"); } }; template struct TDumper> { template static inline void Dump(S& s, const TCopyPtr& v) { s << DumpRaw("TCopyPtr(") << v.Get() << DumpRaw(")"); } }; //small ints // Default dumper prints them via IOutputStream << (value), which results in raw // chars, not integer values. Cast to a bigger int type to force printing as // integers. // NB: i8 = signed char != char != unsigned char = ui8 template <> struct TDumper: public TDumper { }; template <> struct TDumper: public TDumper { }; //chars template <> struct TDumper: public TCharDumper { }; template <> struct TDumper: public TCharDumper { }; //pairs template struct TDumper> { template static inline void Dump(S& s, const std::pair& v) { s.ColorScheme.Key(s); s.ColorScheme.Literal(s); s << v.first; s.ColorScheme.ResetType(s); s.ColorScheme.ResetRole(s); s.ColorScheme.Markup(s); s << DumpRaw(" -> "); s.ColorScheme.Value(s); s.ColorScheme.Literal(s); s << v.second; s.ColorScheme.ResetType(s); s.ColorScheme.ResetRole(s); } }; //sequences template struct TDumper>: public TSeqDumper { }; template struct TDumper>: public TSeqDumper { }; template struct TDumper>: public TSeqDumper { }; template struct TDumper>: public TSeqDumper { }; template struct TDumper>: public TSeqDumper { }; template struct TDumper>: public TSeqDumper { }; //associatives template struct TDumper>: public TAssocDumper { }; template struct TDumper>: public TAssocDumper { }; template struct TDumper>: public TAssocDumper { }; template struct TDumper>: public TAssocDumper { }; template struct TDumper>: public TAssocDumper { }; template struct TDumper>: public TAssocDumper { }; template struct TDumper>: public TAssocDumper { }; template struct TDumper>: public TAssocDumper { }; //strings template <> struct TDumper: public TStrDumper { }; template <> struct TDumper: public TStrDumper { }; template <> struct TDumper: public TStrDumper { }; template <> struct TDumper: public TStrDumper { }; template struct TDumper>: public TStrDumper { }; template struct TDumper>: public TStrDumper { };