The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

SemihostFileSystem.h

Committer:
simon.ford@mbed.co.uk
Date:
2008-04-08
Revision:
0:82220227f4fa
Child:
1:6b7f447ca868

File content as of revision 0:82220227f4fa:

/* 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