mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-21 16:37:12 +01:00
New library for files
This commit is contained in:
50
libraries/lib-files/FileIO.h
Normal file
50
libraries/lib-files/FileIO.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
|
||||
FileIO.h
|
||||
|
||||
Leland Lucius
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __AUDACITY_FILEIO__
|
||||
#define __AUDACITY_FILEIO__
|
||||
|
||||
#include <memory>
|
||||
|
||||
class wxInputStream;
|
||||
class wxOutputStream;
|
||||
class wxFFileOutputStream;
|
||||
class wxFileNameWrapper;
|
||||
|
||||
class FILES_API FileIO
|
||||
{
|
||||
public:
|
||||
typedef enum FileIOMode
|
||||
{
|
||||
Input,
|
||||
Output
|
||||
} FileIOMode;
|
||||
|
||||
public:
|
||||
FileIO(const wxFileNameWrapper & name, FileIOMode mode);
|
||||
|
||||
// Calls Close()
|
||||
~FileIO();
|
||||
|
||||
bool IsOpened();
|
||||
|
||||
bool Close();
|
||||
|
||||
wxInputStream & Read(void *buffer, size_t size);
|
||||
wxOutputStream & Write(const void *buffer, size_t size);
|
||||
|
||||
private:
|
||||
FileIOMode mMode;
|
||||
std::unique_ptr<wxInputStream> mInputStream;
|
||||
std::unique_ptr<wxFFileOutputStream> mOutputStream;
|
||||
bool mOpen;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user