1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-23 06:31:17 +01:00

Use type aliases FilePath, FilePaths...

... for wxString and wxArrayStringEx, holding file paths (absolute or relative,
directory or plain file); to be replaced later with different types

(not yet using std::vector, becase of some uses of wxArrayString::Index with
two arguments)
This commit is contained in:
Paul Licameli
2019-03-07 14:50:22 -05:00
parent 485b6bb425
commit a30000cf74
80 changed files with 371 additions and 342 deletions

View File

@@ -64,8 +64,8 @@ class PROFILE_DLL_API DirManager final : public XMLTagHandler {
public:
ProjectSetter(
DirManager &dirManager,
wxString& newProjPath, // assigns it if empty
const wxString& newProjName, const bool bCreate, bool moving);
FilePath& newProjPath, // assigns it if empty
const FilePath& newProjName, const bool bCreate, bool moving);
~ProjectSetter();
bool Ok();
@@ -82,11 +82,11 @@ class PROFILE_DLL_API DirManager final : public XMLTagHandler {
// This function simply creates a ProjectSetter and commits it if successful.
// Using ProjectSetter directly allows separation of those steps.
bool SetProject(
wxString& newProjPath, // assigns it if empty
const wxString& newProjName, const bool bCreate);
FilePath& newProjPath, // assigns it if empty
const FilePath& newProjName, const bool bCreate);
wxString GetProjectDataDir();
wxString GetProjectName();
FilePath GetProjectDataDir();
FilePath GetProjectName();
wxLongLong GetFreeDiskSpace();
@@ -97,15 +97,15 @@ class PROFILE_DLL_API DirManager final : public XMLTagHandler {
bool allowDeferredWrite = false);
BlockFilePtr
NewAliasBlockFile( const wxString &aliasedFile, sampleCount aliasStart,
NewAliasBlockFile( const FilePath &aliasedFile, sampleCount aliasStart,
size_t aliasLen, int aliasChannel);
BlockFilePtr
NewODAliasBlockFile( const wxString &aliasedFile, sampleCount aliasStart,
NewODAliasBlockFile( const FilePath &aliasedFile, sampleCount aliasStart,
size_t aliasLen, int aliasChannel);
BlockFilePtr
NewODDecodeBlockFile( const wxString &aliasedFile, sampleCount aliasStart,
NewODDecodeBlockFile( const FilePath &aliasedFile, sampleCount aliasStart,
size_t aliasLen, int aliasChannel, int decodeType);
/// Returns true if the blockfile pointed to by b is contained by the DirManager
@@ -128,7 +128,7 @@ class PROFILE_DLL_API DirManager final : public XMLTagHandler {
void SaveBlockFile(BlockFile * f, wxTextFile * out);
#endif
std::pair<bool, wxString>
std::pair<bool, FilePath>
LinkOrCopyToNewProjectDirectory(BlockFile *f, bool &link);
bool EnsureSafeFilename(const wxFileName &fName);
@@ -154,7 +154,7 @@ class PROFILE_DLL_API DirManager final : public XMLTagHandler {
// program is exited normally.
static void CleanTempDir();
static void CleanDir(
const wxString &path,
const FilePath &path,
const wxString &dirSpec,
const wxString &fileSpec,
const wxString &msg,
@@ -176,8 +176,8 @@ class PROFILE_DLL_API DirManager final : public XMLTagHandler {
BlockHash& missingAUHash); // missing data (.au) blockfiles
// Find .au and .auf files that are not in the project.
void FindOrphanBlockFiles(
const wxArrayString& filePathArray, // input: all files in project directory
wxArrayString& orphanFilePathArray); // output: orphan files
const FilePaths &filePathArray, // input: all files in project directory
FilePaths &orphanFilePathArray); // output: orphan files
// Remove all orphaned blockfiles without user interaction. This is
@@ -188,7 +188,7 @@ class PROFILE_DLL_API DirManager final : public XMLTagHandler {
// Get directory where data files are in. Note that projects are normally
// not interested in this information, but it is important for the
// auto-save functionality
wxString GetDataFilesDir() const;
FilePath GetDataFilesDir() const;
// This should only be used by the auto save functionality
void SetLocalTempDir(const wxString &path);
@@ -230,13 +230,13 @@ class PROFILE_DLL_API DirManager final : public XMLTagHandler {
void BalanceFileAdd(int);
int BalanceMidAdd(int, int);
wxString projName;
wxString projPath;
wxString projFull;
FilePath projName;
FilePath projPath;
FilePath projFull;
wxString lastProject;
wxArrayString aliasList;
FilePaths aliasList;
BlockArray *mLoadingTarget;
unsigned mLoadingTargetIdx;