From 76ab3f1ddc143d65e97ab301c742ad6553f1b560 Mon Sep 17 00:00:00 2001 From: Nicolas 'Pixel' Noble Date: Sun, 20 Jan 2013 19:09:14 -0800 Subject: Adding open() as an operation to Input and Output. --- includes/Handle.h | 1 + includes/Input.h | 3 ++- includes/Output.h | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'includes') diff --git a/includes/Handle.h b/includes/Handle.h index e9e94b4..32a5975 100644 --- a/includes/Handle.h +++ b/includes/Handle.h @@ -15,6 +15,7 @@ class FileSystem { class ENoEnt : public GeneralException { public: ENoEnt(const char * name) : GeneralException(String("No such file or directory: `") + name + "'") { } + ENoEnt(const String & name) : ENoEnt(name.to_charp()) { } }; class IOBase; diff --git a/includes/Input.h b/includes/Input.h index e0ad329..51b17c7 100644 --- a/includes/Input.h +++ b/includes/Input.h @@ -6,7 +6,8 @@ namespace Balau { class Input : public SeekableHandle { public: - Input(const char * fname) throw (GeneralException); + Input(const char * fname); + void open() throw (GeneralException); virtual void close() throw (GeneralException); virtual ssize_t read(void * buf, size_t count) throw (GeneralException); virtual bool isClosed(); diff --git a/includes/Output.h b/includes/Output.h index d771227..fec3154 100644 --- a/includes/Output.h +++ b/includes/Output.h @@ -6,7 +6,8 @@ namespace Balau { class Output : public SeekableHandle { public: - Output(const char * fname, bool truncate = true) throw (GeneralException); + Output(const char * fname); + void open(bool truncate = true) throw (GeneralException); virtual void close() throw (GeneralException); virtual ssize_t write(const void * buf, size_t count) throw (GeneralException); virtual bool isClosed(); -- cgit v1.2.3