51 IO_FILE_DESC(
const wxString& aDescription,
const std::vector<std::string>& aFileExtensions,
52 const std::vector<std::string>& aExtsInFolder = {},
bool aIsFile =
true,
53 bool aCanRead =
true,
bool aCanWrite = true ) :
54 m_Description( aDescription ),
55 m_FileExtensions( aFileExtensions ), m_ExtensionsInDir( aExtsInFolder ),
56 m_IsFile( aIsFile ), m_CanRead( aCanRead ), m_CanWrite( aCanWrite )
65 wxString FileFilter()
const;
67 operator bool()
const {
return !m_Description.empty(); }
75 const wxString&
GetName()
const {
return m_name; }
115 virtual bool CanReadLibrary(
const wxString& aFileName )
const;
133 virtual void CreateLibrary(
const wxString& aLibraryPath,
134 const std::map<std::string, UTF8>* aProperties =
nullptr );
153 virtual bool DeleteLibrary(
const wxString& aLibraryPath,
154 const std::map<std::string, UTF8>* aProperties =
nullptr );
166 virtual bool IsLibraryWritable(
const wxString& aLibraryPath );
192 virtual void GetLibraryOptions( std::map<std::string, UTF8>* aListToAppendTo )
const;
196 virtual void AdvanceProgressPhase();
208 m_reporter( nullptr ),
209 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
In case of folders: extensions of files inside.
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.