Final version.
Dependencies: F746_GUI F746_SAI_IO UIT_FFT_Real
Fork of F746_Spectrogram by
mbed_src_STM32F7/api/FileBase.h@4:c1beacfc42c7, 2016-10-02 (annotated)
- Committer:
- MikamiUitOpen
- Date:
- Sun Oct 02 10:51:10 2016 +0000
- Revision:
- 4:c1beacfc42c7
5
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MikamiUitOpen | 4:c1beacfc42c7 | 1 | /* mbed Microcontroller Library |
MikamiUitOpen | 4:c1beacfc42c7 | 2 | * Copyright (c) 2006-2013 ARM Limited |
MikamiUitOpen | 4:c1beacfc42c7 | 3 | * |
MikamiUitOpen | 4:c1beacfc42c7 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
MikamiUitOpen | 4:c1beacfc42c7 | 5 | * you may not use this file except in compliance with the License. |
MikamiUitOpen | 4:c1beacfc42c7 | 6 | * You may obtain a copy of the License at |
MikamiUitOpen | 4:c1beacfc42c7 | 7 | * |
MikamiUitOpen | 4:c1beacfc42c7 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
MikamiUitOpen | 4:c1beacfc42c7 | 9 | * |
MikamiUitOpen | 4:c1beacfc42c7 | 10 | * Unless required by applicable law or agreed to in writing, software |
MikamiUitOpen | 4:c1beacfc42c7 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
MikamiUitOpen | 4:c1beacfc42c7 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
MikamiUitOpen | 4:c1beacfc42c7 | 13 | * See the License for the specific language governing permissions and |
MikamiUitOpen | 4:c1beacfc42c7 | 14 | * limitations under the License. |
MikamiUitOpen | 4:c1beacfc42c7 | 15 | */ |
MikamiUitOpen | 4:c1beacfc42c7 | 16 | #ifndef MBED_FILEBASE_H |
MikamiUitOpen | 4:c1beacfc42c7 | 17 | #define MBED_FILEBASE_H |
MikamiUitOpen | 4:c1beacfc42c7 | 18 | |
MikamiUitOpen | 4:c1beacfc42c7 | 19 | typedef int FILEHANDLE; |
MikamiUitOpen | 4:c1beacfc42c7 | 20 | |
MikamiUitOpen | 4:c1beacfc42c7 | 21 | #include <stdio.h> |
MikamiUitOpen | 4:c1beacfc42c7 | 22 | |
MikamiUitOpen | 4:c1beacfc42c7 | 23 | #if defined(__ARMCC_VERSION) || defined(__ICCARM__) |
MikamiUitOpen | 4:c1beacfc42c7 | 24 | # define O_RDONLY 0 |
MikamiUitOpen | 4:c1beacfc42c7 | 25 | # define O_WRONLY 1 |
MikamiUitOpen | 4:c1beacfc42c7 | 26 | # define O_RDWR 2 |
MikamiUitOpen | 4:c1beacfc42c7 | 27 | # define O_CREAT 0x0200 |
MikamiUitOpen | 4:c1beacfc42c7 | 28 | # define O_TRUNC 0x0400 |
MikamiUitOpen | 4:c1beacfc42c7 | 29 | # define O_APPEND 0x0008 |
MikamiUitOpen | 4:c1beacfc42c7 | 30 | |
MikamiUitOpen | 4:c1beacfc42c7 | 31 | # define NAME_MAX 255 |
MikamiUitOpen | 4:c1beacfc42c7 | 32 | |
MikamiUitOpen | 4:c1beacfc42c7 | 33 | typedef int mode_t; |
MikamiUitOpen | 4:c1beacfc42c7 | 34 | typedef int ssize_t; |
MikamiUitOpen | 4:c1beacfc42c7 | 35 | typedef long off_t; |
MikamiUitOpen | 4:c1beacfc42c7 | 36 | |
MikamiUitOpen | 4:c1beacfc42c7 | 37 | #else |
MikamiUitOpen | 4:c1beacfc42c7 | 38 | # include <sys/fcntl.h> |
MikamiUitOpen | 4:c1beacfc42c7 | 39 | # include <sys/types.h> |
MikamiUitOpen | 4:c1beacfc42c7 | 40 | # include <sys/syslimits.h> |
MikamiUitOpen | 4:c1beacfc42c7 | 41 | #endif |
MikamiUitOpen | 4:c1beacfc42c7 | 42 | |
MikamiUitOpen | 4:c1beacfc42c7 | 43 | #include "platform.h" |
MikamiUitOpen | 4:c1beacfc42c7 | 44 | |
MikamiUitOpen | 4:c1beacfc42c7 | 45 | namespace mbed { |
MikamiUitOpen | 4:c1beacfc42c7 | 46 | |
MikamiUitOpen | 4:c1beacfc42c7 | 47 | typedef enum { |
MikamiUitOpen | 4:c1beacfc42c7 | 48 | FilePathType, |
MikamiUitOpen | 4:c1beacfc42c7 | 49 | FileSystemPathType |
MikamiUitOpen | 4:c1beacfc42c7 | 50 | } PathType; |
MikamiUitOpen | 4:c1beacfc42c7 | 51 | |
MikamiUitOpen | 4:c1beacfc42c7 | 52 | class FileBase { |
MikamiUitOpen | 4:c1beacfc42c7 | 53 | public: |
MikamiUitOpen | 4:c1beacfc42c7 | 54 | FileBase(const char *name, PathType t); |
MikamiUitOpen | 4:c1beacfc42c7 | 55 | |
MikamiUitOpen | 4:c1beacfc42c7 | 56 | virtual ~FileBase(); |
MikamiUitOpen | 4:c1beacfc42c7 | 57 | |
MikamiUitOpen | 4:c1beacfc42c7 | 58 | const char* getName(void); |
MikamiUitOpen | 4:c1beacfc42c7 | 59 | PathType getPathType(void); |
MikamiUitOpen | 4:c1beacfc42c7 | 60 | |
MikamiUitOpen | 4:c1beacfc42c7 | 61 | static FileBase *lookup(const char *name, unsigned int len); |
MikamiUitOpen | 4:c1beacfc42c7 | 62 | |
MikamiUitOpen | 4:c1beacfc42c7 | 63 | static FileBase *get(int n); |
MikamiUitOpen | 4:c1beacfc42c7 | 64 | |
MikamiUitOpen | 4:c1beacfc42c7 | 65 | protected: |
MikamiUitOpen | 4:c1beacfc42c7 | 66 | static FileBase *_head; |
MikamiUitOpen | 4:c1beacfc42c7 | 67 | |
MikamiUitOpen | 4:c1beacfc42c7 | 68 | FileBase *_next; |
MikamiUitOpen | 4:c1beacfc42c7 | 69 | const char *_name; |
MikamiUitOpen | 4:c1beacfc42c7 | 70 | PathType _path_type; |
MikamiUitOpen | 4:c1beacfc42c7 | 71 | |
MikamiUitOpen | 4:c1beacfc42c7 | 72 | /* disallow copy constructor and assignment operators */ |
MikamiUitOpen | 4:c1beacfc42c7 | 73 | private: |
MikamiUitOpen | 4:c1beacfc42c7 | 74 | FileBase(const FileBase&); |
MikamiUitOpen | 4:c1beacfc42c7 | 75 | FileBase & operator = (const FileBase&); |
MikamiUitOpen | 4:c1beacfc42c7 | 76 | }; |
MikamiUitOpen | 4:c1beacfc42c7 | 77 | |
MikamiUitOpen | 4:c1beacfc42c7 | 78 | } // namespace mbed |
MikamiUitOpen | 4:c1beacfc42c7 | 79 | |
MikamiUitOpen | 4:c1beacfc42c7 | 80 | #endif |