8 #ifndef INCL_evo_file_h 9 #define INCL_evo_file_h 88 {
excep(exceptions); }
101 {
excep(exceptions);
open(path, mode, flushlines); }
113 {
excep(exceptions);
open(path, mode,
false); }
void init(Open mode, bool flushlines=false)
Initialize and reset buffers for a new stream.
Definition: iobase.h:1695
#define EVO_THROW_ERR(TYPE, MSG, ERROR)
Throw an Evo exception with error code.
Definition: sys.h:1475
Seek
Seek starting position.
Definition: sysio.h:203
bool excep() const
Get whether exceptions are enabled.
Definition: iobase.h:52
File(const char *path, Open mode, Newline nl, bool exceptions=1)
Constructor to open file and set default newline.
Definition: file.h:112
Error error_
Last error code.
Definition: iobase.h:133
Open
Open mode for files and streams.
Definition: sysio.h:190
bool excep_
Whether to throw exceptions.
Definition: iobase.h:134
Newline
Newline type.
Definition: sys.h:748
IoFile device_
I/O device.
Definition: iobase.h:1687
ulongl seek(Error &err, ulongl offset, Seek start=sBegin)
Seek to file position.
Definition: sysio.h:548
IoWriter bufwr_
Buffered writer.
Definition: iobase.h:1690
No error.
Definition: sys.h:1115
#define EVO_EXCEPTIONS
Whether to throw exceptions on error by default.
Definition: evo_config.h:35
File(Newline nl=NL_SYS, bool exceptions=1)
Constructor.
Definition: file.h:87
Seek from beginning.
Definition: sysio.h:204
Evo base I/O stream classes.
Read only.
Definition: sysio.h:191
File open exception for errors opening a file, see Exception.
Definition: sys.h:1406
bool open(const char *path, Open mode=oREAD, bool flushlines=false)
Open file for read and/or writing.
Definition: file.h:124
RawBuffer readbuf
Primary read buffer – filtering may involve additional buffers.
Definition: sysio.h:661
File I/O stream.
Definition: file.h:77
Error open(const char *path, Open mode, int perm=DEFPERM)
Open file for access.
Definition: sysio.h:462
File(const char *path, Open mode=oREAD, bool flushlines=false, Newline nl=NL_SYS, bool exceptions=1)
Constructor to open file.
Definition: file.h:100
ulongl seek(ulongl offset, Seek start=sBegin)
Seek to file position.
Definition: file.h:154
ulongl pos()
Get current file position.
Definition: file.h:140
Evo C++ Library namespace.
Definition: alg.h:11
Input/Output stream implementation.
Definition: iobase.h:791
Stream< IoFile > Base
Base class alias.
Definition: file.h:79
static const Newline NL_SYS
Current system newline type.
Definition: sys.h:763
bool owned_
Whether handle is owned (to be closed here)
Definition: iobase.h:1688
ulong curbuf_offset
Bytes read from curbuf, i.e. buffer start offset.
Definition: sysio.h:663
ulongl pos(Error &err)
Get current file position.
Definition: sysio.h:527
ulongl savepos_
Read/Write: Used to save buffered read position when switching between read/write.
Definition: iobase.h:1691
bool flush()
Definition: iobase.h:937
IoReader bufrd_
Buffered reader.
Definition: iobase.h:1689
ulong used
Buffer size in use in bytes.
Definition: rawbuffer.h:37