SDFileSystem/LocalFileSystem等の不具合や機種依存性を少なくしたライブラリ。 MiMic用
Dependents: HttpClientSamlpe AsyncHttpdSample MbedFileServer TcpSocketClientSamlpe ... more
Fork of NySDFileSystem by
Revision 10:ae6cec8cecfb, committed 2014-06-24
- Comitter:
- nyatla
- Date:
- Tue Jun 24 09:43:28 2014 +0000
- Parent:
- 8:22ce3449b224
- Child:
- 11:509d2ac0ba4f
- Commit message:
- SDFileSystem??Fork; FileSystem??????????????????
Changed in this revision
LocalFileSystem2.cpp | Show annotated file Show diff for this revision Revisions of this file |
LocalFileSystem2.h | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LocalFileSystem2.cpp Tue Jun 24 09:43:28 2014 +0000 @@ -0,0 +1,29 @@ +#include "LocalFileSystem2.h" +#include "utils/PlatformInfo.h" +namespace MiMic +{ +#ifdef TARGET_LPC1768 + /** + * This module is LocalFileSystem class which is not stopped on LPCXpresso. + * It uses instead of LocalFileSystem. + */ + LocalFileSystem2::LocalFileSystem2(const char* n) : LocalFileSystem(n) + { + this->_is_enable=(PlatformInfo::getPlatformType()==PlatformInfo::PF_MBED); + } + FileHandle *LocalFileSystem2::open(const char* name, int flags) + { + return this->_is_enable?LocalFileSystem::open(name,flags):NULL; + } + int LocalFileSystem2::remove(const char *filename) + { + return this->_is_enable?LocalFileSystem::remove(filename):-1; + } + DirHandle *LocalFileSystem2::opendir(const char *name) + { + return this->_is_enable?LocalFileSystem::opendir(name):NULL; + } +#else + +#endif +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LocalFileSystem2.h Tue Jun 24 09:43:28 2014 +0000 @@ -0,0 +1,32 @@ +#pragma once + + +#include "mbed.h" +#include "FATFileSystem.h" +namespace MiMic +{ + /** + * This module is LocalFileSystem class which is not stopped on LPCXpresso. + * It uses instead of LocalFileSystem. + */ +#ifdef TARGET_LPC1768 + class LocalFileSystem2 : public LocalFileSystem + { + private: + bool _is_enable; + public: + LocalFileSystem2(const char* n); + virtual FileHandle *open(const char* name, int flags); + virtual int remove(const char *filename); + virtual DirHandle *opendir(const char *name); + }; +#else + class LocalFileSystem2 : public FileSystemLike + { + public: + LocalFileSystem2(const char* n):FileSystemLike(n){} + virtual FileHandle *open(const char *filename, int flags){return NULL;} + }; +#endif +} +