14 class file_not_found: public std::runtime_error
17 file_not_found(const std::string &fn): std::runtime_error(fn) { }
22 A class for reading and writing files.
24 Non-blocking mode is not supported on Win32.
26 class File: public Seekable
40 /** Creates a new file object and opens it. If the create flag is set and
41 write access is requested and the file does exist, it is created. Otherwise
42 a missing file is an error. */
43 File(const std::string &, Mode = M_READ, CreateMode = CreateMode(C_CREATE+C_TRUNCATE));
49 virtual unsigned do_write(const char *, unsigned);
50 virtual unsigned do_read(char *, unsigned);
55 virtual SeekOffset seek(SeekOffset, SeekType);
56 virtual SeekOffset tell() const;
58 virtual const Handle &get_handle(Mode);
61 inline File::CreateMode operator|(File::CreateMode m, File::CreateMode n)
62 { return File::CreateMode(static_cast<int>(m)|static_cast<int>(n)); }
64 inline File::CreateMode operator&(File::CreateMode m, File::CreateMode n)
65 { return File::CreateMode(static_cast<int>(m)&static_cast<int>(n)); }
67 inline File::CreateMode operator~(File::CreateMode m)
68 { return File::CreateMode(~static_cast<int>(m)); }
70 typedef Filtered<File, Buffered> BufferedFile;