1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-07 04:01:54 +01:00

Rewrite DirManager::EnsureSafeFileName without downcasts...

... weakening but not yet eliminating dependency on BlockFile subclasses
This commit is contained in:
Paul Licameli
2019-05-14 12:58:20 -04:00
parent d46bb29e3a
commit 81d4c217e6
5 changed files with 50 additions and 27 deletions

View File

@@ -133,6 +133,16 @@ void BlockFile::SetFileName(wxFileNameWrapper &&name)
mFileName=std::move(name);
}
const wxFileNameWrapper &BlockFile::GetExternalFileName() const
{
static wxFileNameWrapper empty;
return empty;
}
void BlockFile::SetExternalFileName( wxFileNameWrapper && )
{
wxASSERT( false );
}
/// Marks this BlockFile as "locked." A locked BlockFile may not
/// be moved or deleted, only copied. Locking a BlockFile prevents
@@ -724,6 +734,16 @@ AliasBlockFile::~AliasBlockFile()
{
}
const wxFileNameWrapper &AliasBlockFile::GetExternalFileName() const
{
return GetAliasedFileName();
}
void AliasBlockFile::SetExternalFileName( wxFileNameWrapper &&newName )
{
ChangeAliasedFileName( std::move( newName ) );
}
/// Read the summary of this alias block from disk. Since the audio data
/// is elsewhere, this consists of reading the entire summary file.
/// Fill with zeroes and return false if data are unavailable for any reason.