RTC auf true
platform/FileBase.h@0:38ceb79fef03, 2018-11-28 (annotated)
- Committer:
- kevman
- Date:
- Wed Nov 28 15:10:15 2018 +0000
- Revision:
- 0:38ceb79fef03
RTC modified
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kevman | 0:38ceb79fef03 | 1 | /* mbed Microcontroller Library |
kevman | 0:38ceb79fef03 | 2 | * Copyright (c) 2006-2013 ARM Limited |
kevman | 0:38ceb79fef03 | 3 | * |
kevman | 0:38ceb79fef03 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
kevman | 0:38ceb79fef03 | 5 | * you may not use this file except in compliance with the License. |
kevman | 0:38ceb79fef03 | 6 | * You may obtain a copy of the License at |
kevman | 0:38ceb79fef03 | 7 | * |
kevman | 0:38ceb79fef03 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
kevman | 0:38ceb79fef03 | 9 | * |
kevman | 0:38ceb79fef03 | 10 | * Unless required by applicable law or agreed to in writing, software |
kevman | 0:38ceb79fef03 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
kevman | 0:38ceb79fef03 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
kevman | 0:38ceb79fef03 | 13 | * See the License for the specific language governing permissions and |
kevman | 0:38ceb79fef03 | 14 | * limitations under the License. |
kevman | 0:38ceb79fef03 | 15 | */ |
kevman | 0:38ceb79fef03 | 16 | #ifndef MBED_FILEBASE_H |
kevman | 0:38ceb79fef03 | 17 | #define MBED_FILEBASE_H |
kevman | 0:38ceb79fef03 | 18 | |
kevman | 0:38ceb79fef03 | 19 | typedef int FILEHANDLE; |
kevman | 0:38ceb79fef03 | 20 | |
kevman | 0:38ceb79fef03 | 21 | #include "platform/platform.h" |
kevman | 0:38ceb79fef03 | 22 | #include "platform/SingletonPtr.h" |
kevman | 0:38ceb79fef03 | 23 | #include "platform/PlatformMutex.h" |
kevman | 0:38ceb79fef03 | 24 | #include "platform/NonCopyable.h" |
kevman | 0:38ceb79fef03 | 25 | |
kevman | 0:38ceb79fef03 | 26 | namespace mbed { |
kevman | 0:38ceb79fef03 | 27 | |
kevman | 0:38ceb79fef03 | 28 | typedef enum { |
kevman | 0:38ceb79fef03 | 29 | FilePathType, |
kevman | 0:38ceb79fef03 | 30 | FileSystemPathType |
kevman | 0:38ceb79fef03 | 31 | } PathType; |
kevman | 0:38ceb79fef03 | 32 | |
kevman | 0:38ceb79fef03 | 33 | /** \addtogroup platform */ |
kevman | 0:38ceb79fef03 | 34 | /** @{*/ |
kevman | 0:38ceb79fef03 | 35 | /** |
kevman | 0:38ceb79fef03 | 36 | * \defgroup platform_FileBase FileBase class |
kevman | 0:38ceb79fef03 | 37 | * @{ |
kevman | 0:38ceb79fef03 | 38 | */ |
kevman | 0:38ceb79fef03 | 39 | /** Class FileBase |
kevman | 0:38ceb79fef03 | 40 | * |
kevman | 0:38ceb79fef03 | 41 | */ |
kevman | 0:38ceb79fef03 | 42 | |
kevman | 0:38ceb79fef03 | 43 | class FileBase : private NonCopyable<FileBase> { |
kevman | 0:38ceb79fef03 | 44 | public: |
kevman | 0:38ceb79fef03 | 45 | FileBase(const char *name, PathType t); |
kevman | 0:38ceb79fef03 | 46 | virtual ~FileBase(); |
kevman | 0:38ceb79fef03 | 47 | |
kevman | 0:38ceb79fef03 | 48 | const char *getName(void); |
kevman | 0:38ceb79fef03 | 49 | PathType getPathType(void); |
kevman | 0:38ceb79fef03 | 50 | |
kevman | 0:38ceb79fef03 | 51 | static FileBase *lookup(const char *name, unsigned int len); |
kevman | 0:38ceb79fef03 | 52 | |
kevman | 0:38ceb79fef03 | 53 | static FileBase *get(int n); |
kevman | 0:38ceb79fef03 | 54 | |
kevman | 0:38ceb79fef03 | 55 | void set_as_default(); |
kevman | 0:38ceb79fef03 | 56 | |
kevman | 0:38ceb79fef03 | 57 | private: |
kevman | 0:38ceb79fef03 | 58 | static FileBase *_head; |
kevman | 0:38ceb79fef03 | 59 | static FileBase *_default; |
kevman | 0:38ceb79fef03 | 60 | static SingletonPtr<PlatformMutex> _mutex; |
kevman | 0:38ceb79fef03 | 61 | |
kevman | 0:38ceb79fef03 | 62 | FileBase *_next; |
kevman | 0:38ceb79fef03 | 63 | const char *const _name; |
kevman | 0:38ceb79fef03 | 64 | const PathType _path_type; |
kevman | 0:38ceb79fef03 | 65 | }; |
kevman | 0:38ceb79fef03 | 66 | |
kevman | 0:38ceb79fef03 | 67 | /**@}*/ |
kevman | 0:38ceb79fef03 | 68 | |
kevman | 0:38ceb79fef03 | 69 | /**@}*/ |
kevman | 0:38ceb79fef03 | 70 | |
kevman | 0:38ceb79fef03 | 71 | } // namespace mbed |
kevman | 0:38ceb79fef03 | 72 | |
kevman | 0:38ceb79fef03 | 73 | #endif |
kevman | 0:38ceb79fef03 | 74 |