summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorNicolas 'Pixel' Noble <pixel@nobis-crew.org>2013-01-20 19:09:14 -0800
committerNicolas 'Pixel' Noble <pixel@nobis-crew.org>2013-01-20 19:09:14 -0800
commit76ab3f1ddc143d65e97ab301c742ad6553f1b560 (patch)
tree301510be8d9d96a1622bd9b0f43648dc74aa01df /includes
parent78d9b284f1879725c071a348c0542c0ff31ab4da (diff)
Adding open() as an operation to Input and Output.
Diffstat (limited to 'includes')
-rw-r--r--includes/Handle.h1
-rw-r--r--includes/Input.h3
-rw-r--r--includes/Output.h3
3 files changed, 5 insertions, 2 deletions
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();