Audacity 3.2.0
Classes | Functions
FileNames Namespace Reference

Classes

struct  FileType
 

Functions

FILES_API wxString FormatWildcard (const FileTypes &fileTypes)
 
FILES_API bool DoCopyFile (const FilePath &file1, const FilePath &file2, bool overwrite=true)
 
FILES_API bool HardLinkFile (const FilePath &file1, const FilePath &file2)
 
FILES_API wxString MkDir (const wxString &Str)
 
FILES_API const FilePathsAudacityPathList ()
 A list of directories that should be searched for Audacity files (plug-ins, help files, etc.). More...
 
FILES_API void SetAudacityPathList (FilePaths list)
 
FILES_API void MakeNameUnique (FilePaths &otherNames, wxFileName &newName)
 
FILES_API wxString LowerCaseAppNameInPath (const wxString &dirIn)
 
FILES_API FilePath CacheDir ()
 Audacity user cache directory. More...
 
FILES_API FilePath ConfigDir ()
 Audacity user config directory. More...
 
FILES_API FilePath DataDir ()
 Audacity user data directory. More...
 
FILES_API FilePath StateDir ()
 Audacity user state directory. More...
 
FILES_API FilePath ResourcesDir ()
 
FILES_API FilePath HtmlHelpDir ()
 
FILES_API FilePath HtmlHelpIndexFile (bool quick)
 
FILES_API FilePath LegacyChainDir ()
 
FILES_API FilePath MacroDir ()
 
FILES_API FilePath NRPDir ()
 
FILES_API FilePath NRPFile ()
 
FILES_API FilePath Configuration ()
 
FILES_API FilePath PluginRegistry ()
 
FILES_API FilePath PluginSettings ()
 
FILES_API FilePath BaseDir ()
 
FILES_API FilePath ModulesDir ()
 
FILES_API FilePath PlugInDir ()
 The user plug-in directory (not a system one) More...
 
FILES_API FilePath PathFromAddr (void *addr)
 
FILES_API bool IsPathAvailable (const FilePath &Path)
 
FILES_API wxFileNameWrapper DefaultToDocumentsFolder (const wxString &preference)
 
FILES_API wxString PreferenceKey (FileNames::Operation op, FileNames::PathType type)
 
FILES_API FilePath FindDefaultPath (Operation op)
 
FILES_API void UpdateDefaultPath (Operation op, const FilePath &path)
 
template<typename F >
FilePath WithDefaultPath (Operation op, const FilePath &defaultPath, F function)
 
FILES_API void AddUniquePathToPathList (const FilePath &path, FilePaths &pathList)
 
FILES_API void AddMultiPathsToPathList (const wxString &multiPathString, FilePaths &pathList)
 
FILES_API void FindFilesInPathList (const wxString &pattern, const FilePaths &pathList, FilePaths &results, int flags=wxDIR_FILES)
 
FILES_API bool WritableLocationCheck (const FilePath &path, const TranslatableString &message)
 Check location on writable access and return true if checked successfully. More...
 
FILES_API int CompareNoCase (const wxString &first, const wxString &second)
 
FILES_API wxString CreateUniqueName (const wxString &prefix, const wxString &suffix=wxEmptyString)
 
FILES_API wxString UnsavedProjectExtension ()
 
FILES_API bool IsOnFATFileSystem (const FilePath &path)
 
FILES_API wxString AbbreviatePath (const wxFileName &fileName)
 Give enough of the path to identify the device. (On Windows, drive letter plus ':') More...
 
FILES_API void InitializePathList ()
 

Function Documentation

◆ AbbreviatePath()

FILES_API wxString FileNames::AbbreviatePath ( const wxFileName &  fileName)

Give enough of the path to identify the device. (On Windows, drive letter plus ':')

Referenced by DBConnection::CheckpointThread(), ProjectFileManager::DoSave(), FileException::ErrorMessage(), ProjectFileIO::ProjectFileIO(), ProjectFileManager::SaveCopy(), and FileException::WriteFailureMessage().

Here is the caller graph for this function:

◆ AddMultiPathsToPathList()

FILES_API void FileNames::AddMultiPathsToPathList ( const wxString &  multiPathString,
FilePaths pathList 
)

Referenced by ModuleManager::DiscoverProviders(), and ModuleManager::FindModules().

Here is the caller graph for this function:

◆ AddUniquePathToPathList()

FILES_API void FileNames::AddUniquePathToPathList ( const FilePath path,
FilePaths pathList 
)

Referenced by ModuleManager::DiscoverProviders(), ModuleManager::FindModules(), and NyquistEffect::GetNyquistSearchPath().

Here is the caller graph for this function:

◆ AudacityPathList()

FILES_API const FilePaths & FileNames::AudacityPathList ( )

A list of directories that should be searched for Audacity files (plug-ins, help files, etc.).

On Unix this will include the directory Audacity was installed into, plus the current user's .audacity-data/Plug-Ins directory. Additional directories can be specified using the AUDACITY_PATH environment variable. On Windows or Mac OS, this will include the directory which contains the Audacity program.

Referenced by ModuleManager::FindModules(), NyquistEffect::GetNyquistSearchPath(), NyquistEffectsModule::Initialize(), LangChoiceDialog::LangChoiceDialog(), LangChoiceDialog::OnOk(), GUIPrefs::Populate(), anonymous_namespace{AudacityApp.cpp}::PopulatePreferences(), NyquistEffect::Process(), and GUISettings::SetLang().

Here is the caller graph for this function:

◆ BaseDir()

FILES_API FilePath FileNames::BaseDir ( )

Referenced by NyquistEffect::Process().

Here is the caller graph for this function:

◆ CacheDir()

FILES_API FilePath FileNames::CacheDir ( )

Audacity user cache directory.

Where audacity keeps its cache squirreled away, by default ~/.cache/audacity/ on Unix, Application Data/Audacity on windows system

Referenced by AboutDialog::PopulateInformationPage().

Here is the caller graph for this function:

◆ CompareNoCase()

FILES_API int FileNames::CompareNoCase ( const wxString &  first,
const wxString &  second 
)

Referenced by anonymous_namespace{FileMenus.cpp}::DoImport(), and ProjectManager::OpenFiles().

Here is the caller graph for this function:

◆ ConfigDir()

FILES_API FilePath FileNames::ConfigDir ( )

Audacity user config directory.

Where audacity keeps its settigns squirreled away, by default ~/.config/audacity/ on Unix, Application Data/Audacity on windows system

Referenced by TimeAndPitchExperimentalSettings::GetLogDir(), audacity::cloud::audiocom::anonymous_namespace{UserService.cpp}::MakeAvatarPath(), audacity::cloud::audiocom::sync::CloudProjectsDatabase::OpenConnection(), and AboutDialog::PopulateInformationPage().

Here is the caller graph for this function:

◆ Configuration()

FILES_API FilePath FileNames::Configuration ( )

◆ CreateUniqueName()

FILES_API wxString FileNames::CreateUniqueName ( const wxString &  prefix,
const wxString &  suffix = wxEmptyString 
)

Referenced by TempDirectory::UnsavedProjectFileName().

Here is the caller graph for this function:

◆ DataDir()

FILES_API FilePath FileNames::DataDir ( )

◆ DefaultToDocumentsFolder()

FILES_API wxFileNameWrapper FileNames::DefaultToDocumentsFolder ( const wxString &  preference)

Referenced by NyquistEffect::resolveFilePath().

Here is the caller graph for this function:

◆ DoCopyFile()

FILES_API bool FileNames::DoCopyFile ( const FilePath file1,
const FilePath file2,
bool  overwrite = true 
)

Referenced by PluginManager::DropFile(), and MacroCommands::MigrateLegacyChains().

Here is the caller graph for this function:

◆ FindDefaultPath()

FILES_API FilePath FileNames::FindDefaultPath ( Operation  op)

◆ FindFilesInPathList()

FILES_API void FileNames::FindFilesInPathList ( const wxString &  pattern,
const FilePaths pathList,
FilePaths results,
int  flags = wxDIR_FILES 
)

Referenced by ModuleManager::DiscoverProviders(), and ModuleManager::FindModules().

Here is the caller graph for this function:

◆ FormatWildcard()

FILES_API wxString FileNames::FormatWildcard ( const FileTypes fileTypes)

Referenced by FileDialogWrapper::Create(), ExportFilePanel::OnFolderBrowse(), and SelectFile().

Here is the caller graph for this function:

◆ HardLinkFile()

FILES_API bool FileNames::HardLinkFile ( const FilePath file1,
const FilePath file2 
)

◆ HtmlHelpDir()

FILES_API FilePath FileNames::HtmlHelpDir ( )

Referenced by FileLink(), LinkingHtmlWindow::OnLinkClicked(), NyquistEffect::Process(), and HelpSystem::ShowHelp().

Here is the caller graph for this function:

◆ HtmlHelpIndexFile()

FILES_API FilePath FileNames::HtmlHelpIndexFile ( bool  quick)

◆ InitializePathList()

FILES_API void FileNames::InitializePathList ( )

Referenced by AudacityApp::OnInit(), and PluginHost::PluginHost().

Here is the caller graph for this function:

◆ IsOnFATFileSystem()

FILES_API bool FileNames::IsOnFATFileSystem ( const FilePath path)

Referenced by ProjectFileManager::DoSave(), TempDirectory::FATFilesystemDenied(), ProjectFileIO::GetFreeDiskSpace(), ProjectFileManager::SaveCopy(), and TempDirectory::TempDir().

Here is the caller graph for this function:

◆ IsPathAvailable()

FILES_API bool FileNames::IsPathAvailable ( const FilePath Path)

Referenced by ProjectFileManager::SaveAs(), and ProjectFileManager::SaveCopy().

Here is the caller graph for this function:

◆ LegacyChainDir()

FILES_API FilePath FileNames::LegacyChainDir ( )

Referenced by MacroCommands::DeleteMacro(), and MacroCommands::MigrateLegacyChains().

Here is the caller graph for this function:

◆ LowerCaseAppNameInPath()

FILES_API wxString FileNames::LowerCaseAppNameInPath ( const wxString &  dirIn)

Referenced by anonymous_namespace{FileNames.cpp}::GetUserTargetDir().

Here is the caller graph for this function:

◆ MacroDir()

FILES_API FilePath FileNames::MacroDir ( )

Referenced by MacroCommands::AddMacro(), MacroCommands::DeleteMacro(), MacroCommands::GetNames(), MacroCommands::MigrateLegacyChains(), MacroCommands::ReadMacro(), MacroCommands::RenameMacro(), and MacroCommands::WriteMacro().

Here is the caller graph for this function:

◆ MakeNameUnique()

FILES_API void FileNames::MakeNameUnique ( FilePaths otherNames,
wxFileName &  newName 
)

Referenced by ExportAudioDialog::UpdateLabelExportSettings(), and ExportAudioDialog::UpdateTrackExportSettings().

Here is the caller graph for this function:

◆ MkDir()

FILES_API wxString FileNames::MkDir ( const wxString &  Str)

◆ ModulesDir()

FILES_API FilePath FileNames::ModulesDir ( )

Referenced by ModuleManager::DiscoverProviders().

Here is the caller graph for this function:

◆ NRPDir()

FILES_API FilePath FileNames::NRPDir ( )

◆ NRPFile()

FILES_API FilePath FileNames::NRPFile ( )

◆ PathFromAddr()

FILES_API FilePath FileNames::PathFromAddr ( void *  addr)

Referenced by MP3Exporter::InitLibraryExternal(), FFmpegFunctions::Private::LibraryWithSymbol(), and FFmpegFunctions::Private::Load().

Here is the caller graph for this function:

◆ PlugInDir()

FILES_API FilePath FileNames::PlugInDir ( )

The user plug-in directory (not a system one)

This returns the string path to where the user may have put plug-ins if they don't have system admin rights. Under default settings, it's <DataDir>/Plug-Ins/

Referenced by PluginManager::FindFilesInPathList(), NyquistEffect::GetNyquistSearchPath(), LadspaEffectsModule::InstallPath(), NyquistEffectsModule::InstallPath(), and NyquistEffect::Process().

Here is the caller graph for this function:

◆ PluginRegistry()

FILES_API FilePath FileNames::PluginRegistry ( )

Referenced by PluginManager::Load(), and PluginManager::Save().

Here is the caller graph for this function:

◆ PluginSettings()

FILES_API FilePath FileNames::PluginSettings ( )

Referenced by PluginManager::GetSettings().

Here is the caller graph for this function:

◆ PreferenceKey()

FILES_API wxString FileNames::PreferenceKey ( FileNames::Operation  op,
FileNames::PathType  type 
)

Referenced by AudacityApp::InitPart2(), DirectoriesPrefs::OnTempBrowse(), DirectoriesPrefs::PopulateOrExchange(), TempDirectory::TempDir(), and WithDefaultPath().

Here is the caller graph for this function:

◆ ResourcesDir()

FILES_API FilePath FileNames::ResourcesDir ( )

Referenced by EQCurveReader::GetDefaultFileName(), anonymous_namespace{MenuHelper.cpp}::IsBundledPlugin(), MenuHelper::PopulateEffectsMenu(), anonymous_namespace{AudacityApp.cpp}::PopulatePreferences(), and EQCurveReader::UpdateDefaultCurves().

Here is the caller graph for this function:

◆ SetAudacityPathList()

FILES_API void FileNames::SetAudacityPathList ( FilePaths  list)

◆ StateDir()

FILES_API FilePath FileNames::StateDir ( )

Audacity user state directory.

Where audacity keeps its user state squirreled away, by default ~/.local/state/audacity/ on Unix, Application Data/Audacity on windows system

Referenced by anonymous_namespace{AudacityApp.cpp}::InitCrashreports(), and AboutDialog::PopulateInformationPage().

Here is the caller graph for this function:

◆ UnsavedProjectExtension()

FILES_API wxString FileNames::UnsavedProjectExtension ( )

Referenced by AutoRecoveryDialog::OnDiscardSelected(), AutoRecoveryDialog::PopulateList(), and TempDirectory::UnsavedProjectFileName().

Here is the caller graph for this function:

◆ UpdateDefaultPath()

FILES_API void FileNames::UpdateDefaultPath ( Operation  op,
const FilePath path 
)

Referenced by anonymous_namespace{FileMenus.cpp}::DoImport(), EVT_MENU_RANGE(), AudacityApp::InitTempDir(), anonymous_namespace{PluginMenus.cpp}::OnResetConfig(), ProjectFileManager::ShowOpenDialog(), TempDirectory::TempDir(), and WithDefaultPath().

Here is the caller graph for this function:

◆ WithDefaultPath()

template<typename F >
FilePath FileNames::WithDefaultPath ( Operation  op,
const FilePath defaultPath,
function 
)

Definition at line 191 of file FileNames.h.

193 {
194 auto path = gPrefs->Read(PreferenceKey(op, PathType::User), defaultPath);
195 if (path.empty())
197 auto result = function(path);
198 FileNames::UpdateDefaultPath(op, ::wxPathOnly(result));
199 return result;
200 }
audacity::BasicSettings * gPrefs
Definition: Prefs.cpp:68
virtual bool Read(const wxString &key, bool *value) const =0
FILES_API wxString PreferenceKey(FileNames::Operation op, FileNames::PathType type)
FILES_API void UpdateDefaultPath(Operation op, const FilePath &path)
FILES_API FilePath FindDefaultPath(Operation op)

References FindDefaultPath(), gPrefs, PreferenceKey(), audacity::BasicSettings::Read(), and UpdateDefaultPath().

Referenced by SelectFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WritableLocationCheck()

FILES_API bool FileNames::WritableLocationCheck ( const FilePath path,
const TranslatableString message 
)

Check location on writable access and return true if checked successfully.

Referenced by anonymous_namespace{AudioComPrefsPanel.cpp}::AudioComPrefsPanel::Browse(), anonymous_namespace{FileMenus.cpp}::DoExport(), audacity::cloud::audiocom::GetUploadTempPath(), DirectoriesPrefs::OnBrowse(), DirectoriesPrefs::OnTempBrowse(), and DirectoriesPrefs::Validate().

Here is the caller graph for this function: