Final version.

Dependencies:   F746_GUI F746_SAI_IO UIT_FFT_Real

Fork of F746_Spectrogram by 不韋 呂

Committer:
MikamiUitOpen
Date:
Sun Oct 02 10:51:10 2016 +0000
Revision:
4:c1beacfc42c7
5

Who changed what in which revision?

UserRevisionLine numberNew 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_FILESYSTEMLIKE_H
MikamiUitOpen 4:c1beacfc42c7 17 #define MBED_FILESYSTEMLIKE_H
MikamiUitOpen 4:c1beacfc42c7 18
MikamiUitOpen 4:c1beacfc42c7 19 #include "platform.h"
MikamiUitOpen 4:c1beacfc42c7 20
MikamiUitOpen 4:c1beacfc42c7 21 #include "FileBase.h"
MikamiUitOpen 4:c1beacfc42c7 22 #include "FileHandle.h"
MikamiUitOpen 4:c1beacfc42c7 23 #include "DirHandle.h"
MikamiUitOpen 4:c1beacfc42c7 24
MikamiUitOpen 4:c1beacfc42c7 25 namespace mbed {
MikamiUitOpen 4:c1beacfc42c7 26
MikamiUitOpen 4:c1beacfc42c7 27 /** A filesystem-like object is one that can be used to open files
MikamiUitOpen 4:c1beacfc42c7 28 * though it by fopen("/name/filename", mode)
MikamiUitOpen 4:c1beacfc42c7 29 *
MikamiUitOpen 4:c1beacfc42c7 30 * Implementations must define at least open (the default definitions
MikamiUitOpen 4:c1beacfc42c7 31 * of the rest of the functions just return error values).
MikamiUitOpen 4:c1beacfc42c7 32 */
MikamiUitOpen 4:c1beacfc42c7 33 class FileSystemLike : public FileBase {
MikamiUitOpen 4:c1beacfc42c7 34
MikamiUitOpen 4:c1beacfc42c7 35 public:
MikamiUitOpen 4:c1beacfc42c7 36 /** FileSystemLike constructor
MikamiUitOpen 4:c1beacfc42c7 37 *
MikamiUitOpen 4:c1beacfc42c7 38 * @param name The name to use for the filesystem.
MikamiUitOpen 4:c1beacfc42c7 39 */
MikamiUitOpen 4:c1beacfc42c7 40 FileSystemLike(const char *name);
MikamiUitOpen 4:c1beacfc42c7 41
MikamiUitOpen 4:c1beacfc42c7 42 virtual ~FileSystemLike();
MikamiUitOpen 4:c1beacfc42c7 43
MikamiUitOpen 4:c1beacfc42c7 44 static DirHandle *opendir();
MikamiUitOpen 4:c1beacfc42c7 45 friend class BaseDirHandle;
MikamiUitOpen 4:c1beacfc42c7 46
MikamiUitOpen 4:c1beacfc42c7 47 /** Opens a file from the filesystem
MikamiUitOpen 4:c1beacfc42c7 48 *
MikamiUitOpen 4:c1beacfc42c7 49 * @param filename The name of the file to open.
MikamiUitOpen 4:c1beacfc42c7 50 * @param flags One of O_RDONLY, O_WRONLY, or O_RDWR, OR'd with
MikamiUitOpen 4:c1beacfc42c7 51 * zero or more of O_CREAT, O_TRUNC, or O_APPEND.
MikamiUitOpen 4:c1beacfc42c7 52 *
MikamiUitOpen 4:c1beacfc42c7 53 * @returns
MikamiUitOpen 4:c1beacfc42c7 54 * A pointer to a FileHandle object representing the
MikamiUitOpen 4:c1beacfc42c7 55 * file on success, or NULL on failure.
MikamiUitOpen 4:c1beacfc42c7 56 */
MikamiUitOpen 4:c1beacfc42c7 57 virtual FileHandle *open(const char *filename, int flags) = 0;
MikamiUitOpen 4:c1beacfc42c7 58
MikamiUitOpen 4:c1beacfc42c7 59 /** Remove a file from the filesystem.
MikamiUitOpen 4:c1beacfc42c7 60 *
MikamiUitOpen 4:c1beacfc42c7 61 * @param filename the name of the file to remove.
MikamiUitOpen 4:c1beacfc42c7 62 * @param returns 0 on success, -1 on failure.
MikamiUitOpen 4:c1beacfc42c7 63 */
MikamiUitOpen 4:c1beacfc42c7 64 virtual int remove(const char *filename) { return -1; };
MikamiUitOpen 4:c1beacfc42c7 65
MikamiUitOpen 4:c1beacfc42c7 66 /** Rename a file in the filesystem.
MikamiUitOpen 4:c1beacfc42c7 67 *
MikamiUitOpen 4:c1beacfc42c7 68 * @param oldname the name of the file to rename.
MikamiUitOpen 4:c1beacfc42c7 69 * @param newname the name to rename it to.
MikamiUitOpen 4:c1beacfc42c7 70 *
MikamiUitOpen 4:c1beacfc42c7 71 * @returns
MikamiUitOpen 4:c1beacfc42c7 72 * 0 on success,
MikamiUitOpen 4:c1beacfc42c7 73 * -1 on failure.
MikamiUitOpen 4:c1beacfc42c7 74 */
MikamiUitOpen 4:c1beacfc42c7 75 virtual int rename(const char *oldname, const char *newname) { return -1; };
MikamiUitOpen 4:c1beacfc42c7 76
MikamiUitOpen 4:c1beacfc42c7 77 /** Opens a directory in the filesystem and returns a DirHandle
MikamiUitOpen 4:c1beacfc42c7 78 * representing the directory stream.
MikamiUitOpen 4:c1beacfc42c7 79 *
MikamiUitOpen 4:c1beacfc42c7 80 * @param name The name of the directory to open.
MikamiUitOpen 4:c1beacfc42c7 81 *
MikamiUitOpen 4:c1beacfc42c7 82 * @returns
MikamiUitOpen 4:c1beacfc42c7 83 * A DirHandle representing the directory stream, or
MikamiUitOpen 4:c1beacfc42c7 84 * NULL on failure.
MikamiUitOpen 4:c1beacfc42c7 85 */
MikamiUitOpen 4:c1beacfc42c7 86 virtual DirHandle *opendir(const char *name) { return NULL; };
MikamiUitOpen 4:c1beacfc42c7 87
MikamiUitOpen 4:c1beacfc42c7 88 /** Creates a directory in the filesystem.
MikamiUitOpen 4:c1beacfc42c7 89 *
MikamiUitOpen 4:c1beacfc42c7 90 * @param name The name of the directory to create.
MikamiUitOpen 4:c1beacfc42c7 91 * @param mode The permissions to create the directory with.
MikamiUitOpen 4:c1beacfc42c7 92 *
MikamiUitOpen 4:c1beacfc42c7 93 * @returns
MikamiUitOpen 4:c1beacfc42c7 94 * 0 on success,
MikamiUitOpen 4:c1beacfc42c7 95 * -1 on failure.
MikamiUitOpen 4:c1beacfc42c7 96 */
MikamiUitOpen 4:c1beacfc42c7 97 virtual int mkdir(const char *name, mode_t mode) { return -1; }
MikamiUitOpen 4:c1beacfc42c7 98
MikamiUitOpen 4:c1beacfc42c7 99 // TODO other filesystem functions (mkdir, rm, rn, ls etc)
MikamiUitOpen 4:c1beacfc42c7 100 };
MikamiUitOpen 4:c1beacfc42c7 101
MikamiUitOpen 4:c1beacfc42c7 102 } // namespace mbed
MikamiUitOpen 4:c1beacfc42c7 103
MikamiUitOpen 4:c1beacfc42c7 104 #endif