From 8b1e278ef364fff2aa7d6b805353a722db1b4b89 Mon Sep 17 00:00:00 2001 From: Pixel Date: Tue, 25 Oct 2011 17:11:08 -0700 Subject: Adding the FileSystem global class with mkdir, and adding the writeString method to Handles. Also preparing the inclusion of Lua by adding LuaJIT. --- includes/Handle.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'includes/Handle.h') diff --git a/includes/Handle.h b/includes/Handle.h index 2f2a029..96f1736 100644 --- a/includes/Handle.h +++ b/includes/Handle.h @@ -5,6 +5,11 @@ namespace Balau { +class FileSystem { + public: + static int mkdir(const char * path) throw (GeneralException); +}; + class ENoEnt : public GeneralException { public: ENoEnt(const char * name) : GeneralException(String("No such file or directory: `") + name + "'") { } @@ -27,6 +32,8 @@ class Handle { virtual const char * getName() = 0; virtual ssize_t read(void * buf, size_t count) throw (GeneralException); virtual ssize_t write(const void * buf, size_t count) throw (GeneralException); + void writeString(const char * str, size_t len = -1) { if (len < 0) len = strlen(str); write(str, len); } + void writeString(const String & str) { write(str.to_charp(), str.strlen()); } virtual void rseek(off_t offset, int whence = SEEK_SET) throw (GeneralException); virtual void wseek(off_t offset, int whence = SEEK_SET) throw (GeneralException); virtual off_t rtell() throw (GeneralException); -- cgit v1.2.3