ads1115 only
Fork of mbed by
Diff: FileSystemLike.h
- Revision:
- 54:71b101360fb9
- Parent:
- 48:49c296715c73
- Child:
- 55:d722ed6a4237
--- a/FileSystemLike.h Thu Dec 06 17:03:27 2012 +0000 +++ b/FileSystemLike.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,21 +22,9 @@ #ifndef MBED_FILESYSTEMLIKE_H #define MBED_FILESYSTEMLIKE_H -#ifdef __ARMCC_VERSION -# define O_RDONLY 0 -# define O_WRONLY 1 -# define O_RDWR 2 -# define O_CREAT 0x0200 -# define O_TRUNC 0x0400 -# define O_APPEND 0x0008 -typedef int mode_t; - -#else -# include <sys/fcntl.h> -#endif - #include "platform.h" +#include "FileBase.h" #include "FileHandle.h" #include "DirHandle.h" @@ -48,7 +36,7 @@ * Implementations must define at least open (the default definitions * of the rest of the functions just return error values). */ -class FileSystemLike { +class FileSystemLike : public FileBase { public: /** FileSystemLike constructor @@ -59,15 +47,6 @@ virtual ~FileSystemLike(); - /* Function lookup - * Lookup and return the object that has the given name. - * - * Variables - * name - the name to lookup. - * len - the length of name. - */ - static FileSystemLike *lookup(const char *name, unsigned int len); - static DirHandle *opendir(); friend class BaseDirHandle; @@ -122,25 +101,8 @@ * -1 on failure. */ virtual int mkdir(const char *name, mode_t mode) { return -1; } - + // TODO other filesystem functions (mkdir, rm, rn, ls etc) - -protected: - static FileSystemLike *_head; - FileSystemLike *_next; - const char *_name; -}; - -class FilePath { -public: - FilePath(const char* file_path); - - const char* fileName(void); - FileSystemLike* fileSystem(void); - -private: - const char* file_name; - FileSystemLike* fs; }; } // namespace mbed