From c2f38d0db74ee1eebb2cfd265a035141d8106fcd Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 13 Oct 2019 16:29:02 +0200 Subject: [PATCH] Implement removal of user data files. --- server/TracyUserData.cpp | 7 +++++++ server/TracyUserData.hpp | 1 + 2 files changed, 8 insertions(+) diff --git a/server/TracyUserData.cpp b/server/TracyUserData.cpp index d2f81003..1c62d488 100644 --- a/server/TracyUserData.cpp +++ b/server/TracyUserData.cpp @@ -151,4 +151,11 @@ FILE* UserData::OpenFile( const char* filename, bool write ) return f; } +void UserData::Remove( const char* filename ) +{ + const auto path = GetSavePath( m_program.c_str(), m_time, filename, false ); + if( !path ) return; + unlink( path ); +} + } diff --git a/server/TracyUserData.hpp b/server/TracyUserData.hpp index 8e8450e6..f361325b 100644 --- a/server/TracyUserData.hpp +++ b/server/TracyUserData.hpp @@ -28,6 +28,7 @@ public: private: FILE* OpenFile( const char* filename, bool write ); + void Remove( const char* filename ); std::string m_program; uint64_t m_time;