游戏王对战板,目前code还是空的

Committer:
WFKnight
Date:
Thu Jun 21 13:51:43 2018 +0000
Revision:
0:9b3d4731edbb
UART, RTOS, LED

Who changed what in which revision?

UserRevisionLine numberNew contents of line
WFKnight 0:9b3d4731edbb 1 /* mbed Microcontroller Library
WFKnight 0:9b3d4731edbb 2 * Copyright (c) 2006-2013 ARM Limited
WFKnight 0:9b3d4731edbb 3 *
WFKnight 0:9b3d4731edbb 4 * Licensed under the Apache License, Version 2.0 (the "License");
WFKnight 0:9b3d4731edbb 5 * you may not use this file except in compliance with the License.
WFKnight 0:9b3d4731edbb 6 * You may obtain a copy of the License at
WFKnight 0:9b3d4731edbb 7 *
WFKnight 0:9b3d4731edbb 8 * http://www.apache.org/licenses/LICENSE-2.0
WFKnight 0:9b3d4731edbb 9 *
WFKnight 0:9b3d4731edbb 10 * Unless required by applicable law or agreed to in writing, software
WFKnight 0:9b3d4731edbb 11 * distributed under the License is distributed on an "AS IS" BASIS,
WFKnight 0:9b3d4731edbb 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
WFKnight 0:9b3d4731edbb 13 * See the License for the specific language governing permissions and
WFKnight 0:9b3d4731edbb 14 * limitations under the License.
WFKnight 0:9b3d4731edbb 15 */
WFKnight 0:9b3d4731edbb 16 #ifndef MBED_FILESYSTEMHANDLE_H
WFKnight 0:9b3d4731edbb 17 #define MBED_FILESYSTEMHANDLE_H
WFKnight 0:9b3d4731edbb 18
WFKnight 0:9b3d4731edbb 19 #include "platform/platform.h"
WFKnight 0:9b3d4731edbb 20
WFKnight 0:9b3d4731edbb 21 #include "platform/FileBase.h"
WFKnight 0:9b3d4731edbb 22 #include "platform/FileHandle.h"
WFKnight 0:9b3d4731edbb 23 #include "platform/DirHandle.h"
WFKnight 0:9b3d4731edbb 24 #include "platform/NonCopyable.h"
WFKnight 0:9b3d4731edbb 25
WFKnight 0:9b3d4731edbb 26 namespace mbed {
WFKnight 0:9b3d4731edbb 27 /** \addtogroup platform */
WFKnight 0:9b3d4731edbb 28 /** @{*/
WFKnight 0:9b3d4731edbb 29 /**
WFKnight 0:9b3d4731edbb 30 * \defgroup platform_FileSystemHandle FileSystemHandle functions
WFKnight 0:9b3d4731edbb 31 * @{
WFKnight 0:9b3d4731edbb 32 */
WFKnight 0:9b3d4731edbb 33
WFKnight 0:9b3d4731edbb 34
WFKnight 0:9b3d4731edbb 35 /** A filesystem-like object is one that can be used to open file-like
WFKnight 0:9b3d4731edbb 36 * objects though it by fopen("/name/filename", mode)
WFKnight 0:9b3d4731edbb 37 *
WFKnight 0:9b3d4731edbb 38 * Implementations must define at least open (the default definitions
WFKnight 0:9b3d4731edbb 39 * of the rest of the functions just return error values).
WFKnight 0:9b3d4731edbb 40 *
WFKnight 0:9b3d4731edbb 41 * @note Synchronization level: Set by subclass
WFKnight 0:9b3d4731edbb 42 */
WFKnight 0:9b3d4731edbb 43 class FileSystemHandle : private NonCopyable<FileSystemHandle> {
WFKnight 0:9b3d4731edbb 44 public:
WFKnight 0:9b3d4731edbb 45 /** FileSystemHandle lifetime
WFKnight 0:9b3d4731edbb 46 */
WFKnight 0:9b3d4731edbb 47 virtual ~FileSystemHandle() {}
WFKnight 0:9b3d4731edbb 48
WFKnight 0:9b3d4731edbb 49 /** Open a file on the filesystem
WFKnight 0:9b3d4731edbb 50 *
WFKnight 0:9b3d4731edbb 51 * @param file Destination for the handle to a newly created file
WFKnight 0:9b3d4731edbb 52 * @param filename The name of the file to open
WFKnight 0:9b3d4731edbb 53 * @param flags The flags to open the file in, one of O_RDONLY, O_WRONLY, O_RDWR,
WFKnight 0:9b3d4731edbb 54 * bitwise or'd with one of O_CREAT, O_TRUNC, O_APPEND
WFKnight 0:9b3d4731edbb 55 * @return 0 on success, negative error code on failure
WFKnight 0:9b3d4731edbb 56 */
WFKnight 0:9b3d4731edbb 57 virtual int open(FileHandle **file, const char *filename, int flags) = 0;
WFKnight 0:9b3d4731edbb 58
WFKnight 0:9b3d4731edbb 59 /** Open a directory on the filesystem
WFKnight 0:9b3d4731edbb 60 *
WFKnight 0:9b3d4731edbb 61 * @param dir Destination for the handle to the directory
WFKnight 0:9b3d4731edbb 62 * @param path Name of the directory to open
WFKnight 0:9b3d4731edbb 63 * @return 0 on success, negative error code on failure
WFKnight 0:9b3d4731edbb 64 */
WFKnight 0:9b3d4731edbb 65 virtual int open(DirHandle **dir, const char *path);
WFKnight 0:9b3d4731edbb 66
WFKnight 0:9b3d4731edbb 67 /** Remove a file from the filesystem.
WFKnight 0:9b3d4731edbb 68 *
WFKnight 0:9b3d4731edbb 69 * @param path The name of the file to remove.
WFKnight 0:9b3d4731edbb 70 * @return 0 on success, negative error code on failure
WFKnight 0:9b3d4731edbb 71 */
WFKnight 0:9b3d4731edbb 72 virtual int remove(const char *path);
WFKnight 0:9b3d4731edbb 73
WFKnight 0:9b3d4731edbb 74 /** Rename a file in the filesystem.
WFKnight 0:9b3d4731edbb 75 *
WFKnight 0:9b3d4731edbb 76 * @param path The name of the file to rename.
WFKnight 0:9b3d4731edbb 77 * @param newpath The name to rename it to
WFKnight 0:9b3d4731edbb 78 * @return 0 on success, negative error code on failure
WFKnight 0:9b3d4731edbb 79 */
WFKnight 0:9b3d4731edbb 80 virtual int rename(const char *path, const char *newpath);
WFKnight 0:9b3d4731edbb 81
WFKnight 0:9b3d4731edbb 82 /** Store information about the file in a stat structure
WFKnight 0:9b3d4731edbb 83 *
WFKnight 0:9b3d4731edbb 84 * @param path The name of the file to find information about
WFKnight 0:9b3d4731edbb 85 * @param st The stat buffer to write to
WFKnight 0:9b3d4731edbb 86 * @return 0 on success, negative error code on failure
WFKnight 0:9b3d4731edbb 87 */
WFKnight 0:9b3d4731edbb 88 virtual int stat(const char *path, struct stat *st);
WFKnight 0:9b3d4731edbb 89
WFKnight 0:9b3d4731edbb 90 /** Create a directory in the filesystem.
WFKnight 0:9b3d4731edbb 91 *
WFKnight 0:9b3d4731edbb 92 * @param path The name of the directory to create.
WFKnight 0:9b3d4731edbb 93 * @param mode The permissions with which to create the directory
WFKnight 0:9b3d4731edbb 94 * @return 0 on success, negative error code on failure
WFKnight 0:9b3d4731edbb 95 */
WFKnight 0:9b3d4731edbb 96 virtual int mkdir(const char *path, mode_t mode);
WFKnight 0:9b3d4731edbb 97
WFKnight 0:9b3d4731edbb 98 /** Store information about the mounted filesystem in a statvfs structure
WFKnight 0:9b3d4731edbb 99 *
WFKnight 0:9b3d4731edbb 100 * @param path The name of the file to find information about
WFKnight 0:9b3d4731edbb 101 * @param buf The stat buffer to write to
WFKnight 0:9b3d4731edbb 102 * @return 0 on success, negative error code on failure
WFKnight 0:9b3d4731edbb 103 */
WFKnight 0:9b3d4731edbb 104 virtual int statvfs(const char *path, struct statvfs *buf);
WFKnight 0:9b3d4731edbb 105 };
WFKnight 0:9b3d4731edbb 106 /**@}*/
WFKnight 0:9b3d4731edbb 107
WFKnight 0:9b3d4731edbb 108 /**@}*/
WFKnight 0:9b3d4731edbb 109
WFKnight 0:9b3d4731edbb 110 } // namespace mbed
WFKnight 0:9b3d4731edbb 111
WFKnight 0:9b3d4731edbb 112 #endif
WFKnight 0:9b3d4731edbb 113
WFKnight 0:9b3d4731edbb 114 /** @}*/