55 IO_FILE_DESC(
const wxString& aDescription,
const std::vector<std::string>& aFileExtensions,
56 const std::vector<std::string>& aExtsInFolder = {},
bool aIsFile =
true,
57 bool aCanRead =
true,
bool aCanWrite = true ) :
58 m_Description( aDescription ),
59 m_FileExtensions( aFileExtensions ), m_ExtensionsInDir( aExtsInFolder ),
60 m_IsFile( aIsFile ), m_CanRead( aCanRead ), m_CanWrite( aCanWrite )
69 wxString FileFilter()
const;
71 operator bool()
const {
return !m_Description.empty(); }
79 const wxString&
GetName()
const {
return m_name; }
91 m_progressReporter = aReporter;
121 virtual bool CanReadLibrary(
const wxString& aFileName )
const;
139 virtual void CreateLibrary(
const wxString& aLibraryPath,
140 const std::map<std::string, UTF8>* aProperties =
nullptr );
159 virtual bool DeleteLibrary(
const wxString& aLibraryPath,
160 const std::map<std::string, UTF8>* aProperties =
nullptr );
172 virtual bool IsLibraryWritable(
const wxString& aLibraryPath );
198 virtual void GetLibraryOptions( std::map<std::string, UTF8>* aListToAppendTo )
const;
202 virtual void AdvanceProgressPhase();
213 m_reporter( nullptr ),
214 m_progressReporter( nullptr )
const wxString & GetName() const
Return a brief hard coded name for this IO interface.
REPORTER * m_reporter
Reporter to log errors/warnings to, may be nullptr.
wxString m_name
Name of the IO loader.
virtual const IO_FILE_DESC GetLibraryFileDesc() const
Get the descriptor for the individual library elements that this IO plugin operates on.
IO_BASE(const wxString &aName)
virtual ~IO_BASE()=default
virtual const IO_FILE_DESC GetLibraryDesc() const =0
Get the descriptor for the library container that this IO plugin operates on.
virtual void SetReporter(REPORTER *aReporter)
Set an optional reporter for warnings/errors.
virtual void SetProgressReporter(PROGRESS_REPORTER *aReporter)
Set an optional progress reporter.
PROGRESS_REPORTER * m_progressReporter
Progress reporter to track the progress of the operation, may be nullptr.
A progress reporter interface for use in multi-threaded environments.
A pure virtual class used to derive REPORTER objects from.
Container that describes file type info.
std::vector< std::string > m_ExtensionsInDir
IO_FILE_DESC(const wxString &aDescription, const std::vector< std::string > &aFileExtensions, const std::vector< std::string > &aExtsInFolder={}, bool aIsFile=true, bool aCanRead=true, bool aCanWrite=true)
bool m_IsFile
Whether the library is a folder or a file.
wxString m_Description
Description shown in the file picker dialog.
bool m_CanWrite
Whether the IO can write this file type.
std::vector< std::string > m_FileExtensions
Filter used for file pickers if m_IsFile is true.
bool m_CanRead
Whether the IO can read this file type.