From 9da7e58ec5125b2f11a2a31f75f7a15868169f96 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 21 Sep 2017 02:10:20 +0200 Subject: [PATCH] String getter. --- server/TracyView.cpp | 13 +++++++++++++ server/TracyView.hpp | 1 + 2 files changed, 14 insertions(+) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 8d2eb960..014d6f2f 100755 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -386,6 +386,19 @@ const char* View::TimeToString( uint64_t ns ) const return buf; } +const char* View::GetString( uint64_t ptr ) const +{ + const auto it = m_strings.find( ptr ); + if( it == m_strings.end() ) + { + return "???"; + } + else + { + return it->second.c_str(); + } +} + void View::Draw() { s_instance->DrawImpl(); diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 63bfa9af..22ad7cdd 100755 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -53,6 +53,7 @@ private: uint64_t GetFrameEnd( size_t idx ) const; uint64_t GetLastTime() const; const char* TimeToString( uint64_t ns ) const; + const char* GetString( uint64_t ptr ) const; void DrawImpl(); void DrawFrames();