mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 04:23:51 +00:00
User data directory location getter.
This commit is contained in:
parent
36942a5ddb
commit
9e76ddb9fd
@ -117,7 +117,6 @@ const char* GetSavePath( const char* file )
|
||||
|
||||
const char* GetSavePath( const char* program, uint64_t time, const char* file, bool create )
|
||||
{
|
||||
assert( file && *file );
|
||||
assert( program && *program );
|
||||
|
||||
enum { Pool = 8 };
|
||||
@ -195,9 +194,16 @@ const char* GetSavePath( const char* program, uint64_t time, const char* file, b
|
||||
assert( status );
|
||||
}
|
||||
|
||||
const auto fsz = strlen( file );
|
||||
assert( sz + fsz < MaxPath );
|
||||
memcpy( buf+sz, file, fsz+1 );
|
||||
if( file )
|
||||
{
|
||||
const auto fsz = strlen( file );
|
||||
assert( sz + fsz < MaxPath );
|
||||
memcpy( buf+sz, file, fsz+1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
buf[sz] = '\0';
|
||||
}
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
@ -236,4 +236,10 @@ void UserData::Remove( const char* filename )
|
||||
unlink( path );
|
||||
}
|
||||
|
||||
const char* UserData::GetConfigLocation() const
|
||||
{
|
||||
assert( Valid() );
|
||||
return GetSavePath( m_program.c_str(), m_time, nullptr, false );
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -32,6 +32,8 @@ public:
|
||||
void LoadAnnotations( std::vector<std::unique_ptr<Annotation>>& data );
|
||||
void SaveAnnotations( const std::vector<std::unique_ptr<Annotation>>& data );
|
||||
|
||||
const char* GetConfigLocation() const;
|
||||
|
||||
private:
|
||||
FILE* OpenFile( const char* filename, bool write );
|
||||
void Remove( const char* filename );
|
||||
|
Loading…
x
Reference in New Issue
Block a user