Implement removal of user data files.

This commit is contained in:
Bartosz Taudul 2019-10-13 16:29:02 +02:00
parent 9d0316342d
commit c2f38d0db7
2 changed files with 8 additions and 0 deletions

View File

@ -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 );
}
}

View File

@ -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;