Audacity 3.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 <memory>
15
16class wxInputStream;
17class wxOutputStream;
18class wxFFileOutputStream;
20
21class FILES_API FileIO
22{
23 public:
24 typedef enum FileIOMode
25 {
27 Output
28 } FileIOMode;
29
30 public:
31 FileIO(const wxFileNameWrapper & name, FileIOMode mode);
32
33 // Calls Close()
34 ~FileIO();
35
36 bool IsOpened();
37
38 bool Close();
39
40 wxInputStream & Read(void *buffer, size_t size);
41 wxOutputStream & Write(const void *buffer, size_t size);
42
43 private:
45 std::unique_ptr<wxInputStream> mInputStream;
46 std::unique_ptr<wxFFileOutputStream> mOutputStream;
47 bool mOpen;
48};
49
50#endif
wxString name
Definition: TagsEditor.cpp:166
Definition: FileIO.h:22
FileIOMode mMode
Definition: FileIO.h:44
FileIOMode
Definition: FileIO.h:25
@ Input
Definition: FileIO.h:26
std::unique_ptr< wxInputStream > mInputStream
Definition: FileIO.h:45
bool mOpen
Definition: FileIO.h:47
std::unique_ptr< wxFFileOutputStream > mOutputStream
Definition: FileIO.h:46
void Output(const wxString &string)