Audacity  2.2.0
FileIO.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  FileIO.h
6 
7  Leland Lucius
8 
9 **********************************************************************/
10 
11 #ifndef __AUDACITY_FILEIO__
12 #define __AUDACITY_FILEIO__
13 
14 #include "MemoryX.h"
15 #include <wx/object.h>
16 #include <wx/wfstream.h>
17 
18 class FileIO
19 {
20  public:
21  typedef enum FileIOMode
22  {
25  } FileIOMode;
26 
27  public:
28  FileIO(const wxString & name, FileIOMode mode);
29 
30  // Calls Close()
31  ~FileIO();
32 
33  bool IsOpened();
34 
35  void Close();
36 
37  wxInputStream & Read(void *buffer, size_t size);
38  wxOutputStream & Write(const void *buffer, size_t size);
39 
40  private:
41  wxString mName;
43  std::unique_ptr<wxInputStream> mInputStream;
44  std::unique_ptr<wxOutputStream> mOutputStream;
45  bool mOpen;
46 };
47 
48 #endif
wxString mName
Definition: FileIO.h:41
FileIOMode
Definition: FileIO.h:21
void Close()
Definition: FileIO.cpp:55
std::unique_ptr< wxOutputStream > mOutputStream
Definition: FileIO.h:44
bool IsOpened()
Definition: FileIO.cpp:50
FileIO(const wxString &name, FileIOMode mode)
Definition: FileIO.cpp:20
wxOutputStream & Write(const void *buffer, size_t size)
Definition: FileIO.cpp:71
~FileIO()
Definition: FileIO.cpp:45
std::unique_ptr< wxInputStream > mInputStream
Definition: FileIO.h:43
const wxChar * name
Definition: Distortion.cpp:94
Definition: FileIO.h:24
FileIOMode mMode
Definition: FileIO.h:42
Definition: FileIO.h:23
bool mOpen
Definition: FileIO.h:45
wxInputStream & Read(void *buffer, size_t size)
Definition: FileIO.cpp:62
Definition: FileIO.h:18