Audacity  3.0.3
SelectFile.h
Go to the documentation of this file.
1 /*!********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  @file SelectFile.h
6 
7  Paul Licameli split from FileNames.h
8 
9  **********************************************************************/
10 
11 #ifndef __AUDACITY_SELECT_FILE__
12 #define __AUDACITY_SELECT_FILE__
13 
14 #include "Identifier.h" // for FilePath
15 #include <vector>
16 class wxWindow;
17 
18 class TranslatableString;
19 namespace FileNames {
20  enum class Operation;
21  struct FileType;
22 }
23 using FileTypes = std::vector< FileNames::FileType >;
24 
25 AUDACITY_DLL_API FilePath
26 SelectFile(FileNames::Operation op, // op matters only when default_path is empty
27  const TranslatableString& message,
28  const FilePath& default_path,
29  const FilePath& default_filename,
30  const FileExtension& default_extension,
31  const FileTypes& fileTypes,
32  int flags,
33  wxWindow *parent);
34 
37 #if defined(__WXMSW__)
38 AUDACITY_DLL_API char *VerifyFilename(const wxString &s, bool input = true);
39 #endif
40 
41 // Use this macro to wrap all filenames and pathnames that get
42 // passed directly to a system call, like opening a file, creating
43 // a directory, checking to see that a file exists, etc...
44 #if defined(__WXMSW__)
45 // Note, on Windows we don't define an OSFILENAME() to prevent accidental use.
46 // See VerifyFilename() for an explanation.
47 #define OSINPUT(X) VerifyFilename(X, true)
48 #define OSOUTPUT(X) VerifyFilename(X, false)
49 #elif defined(__WXMAC__)
50 #define OSFILENAME(X) ((char *) (const char *)(X).fn_str())
51 #define OSINPUT(X) OSFILENAME(X)
52 #define OSOUTPUT(X) OSFILENAME(X)
53 #else
54 #define OSFILENAME(X) ((char *) (const char *)(X).mb_str())
55 #define OSINPUT(X) OSFILENAME(X)
56 #define OSOUTPUT(X) OSFILENAME(X)
57 #endif
58 
59 #endif
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
FileExtension
wxString FileExtension
File extension, not including any leading dot.
Definition: Identifier.h:224
FilePath
wxString FilePath
Definition: Project.h:20
FileNames
Definition: SelectFile.h:19
FileTypes
std::vector< FileNames::FileType > FileTypes
Definition: SelectFile.h:23
Identifier.h
SelectFile
AUDACITY_DLL_API FilePath SelectFile(FileNames::Operation op, const TranslatableString &message, const FilePath &default_path, const FilePath &default_filename, const FileExtension &default_extension, const FileTypes &fileTypes, int flags, wxWindow *parent)
Definition: SelectFile.cpp:17
FileNames::Operation
Operation
Definition: FileNames.h:147