Lab 1 Program C

Dependents:   Lab1C

Fork of mbed by -deleted-

Revision:
0:82220227f4fa
Child:
1:6b7f447ca868
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SemihostFileSystem.h	Tue Apr 08 14:12:21 2008 +0000
@@ -0,0 +1,38 @@
+/* mbed Microcontroller Library - SemihostFileSystem
+ * Copyright (c) 2007-2008, sford
+ */
+
+#ifndef MBED_SEMIHOSTFILESYSTEM_H
+#define MBED_SEMIHOSTFILESYSTEM_H
+
+#include "rt_sys.h"
+
+#include "SemihostFileHandle.h"
+
+extern "C" FILEHANDLE $Super$$_sys_open(const char *name, int openmode);
+
+namespace mbed {
+
+/* Class SemihostFileSystem
+ *  A file system invoking the standard semihosting implementation
+ */
+class SemihostFileSystem : public Base {
+
+public:
+
+	SemihostFileSystem(char* n) {
+		name(n);
+		_type = "SemihostFileSystem";
+	}
+	
+	virtual FILEHANDLE sys_open(const char* name, int openmode) {
+		FILEHANDLE fh = $Super$$_sys_open(name, openmode);
+		FileHandle* fhc = new SemihostFileHandle(fh);
+		return (FILEHANDLE)fhc;
+	}
+	
+};
+
+} // namespace mbed
+
+#endif
\ No newline at end of file