Describes predefine macros for mbed online compiler (armcc)

Committer:
MACRUM
Date:
Thu Mar 16 21:58:09 2017 +0900
Revision:
6:40e873bbc5f7
Add licence header info

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MACRUM 6:40e873bbc5f7 1 /* mbed Microcontroller Library
MACRUM 6:40e873bbc5f7 2 * Copyright (c) 2006-2013 ARM Limited
MACRUM 6:40e873bbc5f7 3 *
MACRUM 6:40e873bbc5f7 4 * Licensed under the Apache License, Version 2.0 (the "License");
MACRUM 6:40e873bbc5f7 5 * you may not use this file except in compliance with the License.
MACRUM 6:40e873bbc5f7 6 * You may obtain a copy of the License at
MACRUM 6:40e873bbc5f7 7 *
MACRUM 6:40e873bbc5f7 8 * http://www.apache.org/licenses/LICENSE-2.0
MACRUM 6:40e873bbc5f7 9 *
MACRUM 6:40e873bbc5f7 10 * Unless required by applicable law or agreed to in writing, software
MACRUM 6:40e873bbc5f7 11 * distributed under the License is distributed on an "AS IS" BASIS,
MACRUM 6:40e873bbc5f7 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
MACRUM 6:40e873bbc5f7 13 * See the License for the specific language governing permissions and
MACRUM 6:40e873bbc5f7 14 * limitations under the License.
MACRUM 6:40e873bbc5f7 15 */
MACRUM 6:40e873bbc5f7 16 #ifndef MBED_FILEBASE_H
MACRUM 6:40e873bbc5f7 17 #define MBED_FILEBASE_H
MACRUM 6:40e873bbc5f7 18
MACRUM 6:40e873bbc5f7 19 typedef int FILEHANDLE;
MACRUM 6:40e873bbc5f7 20
MACRUM 6:40e873bbc5f7 21 #include <cstdio>
MACRUM 6:40e873bbc5f7 22 #include <cstring>
MACRUM 6:40e873bbc5f7 23
MACRUM 6:40e873bbc5f7 24 #include "platform/platform.h"
MACRUM 6:40e873bbc5f7 25 #include "platform/SingletonPtr.h"
MACRUM 6:40e873bbc5f7 26 #include "platform/PlatformMutex.h"
MACRUM 6:40e873bbc5f7 27
MACRUM 6:40e873bbc5f7 28 namespace mbed {
MACRUM 6:40e873bbc5f7 29 /** \addtogroup drivers */
MACRUM 6:40e873bbc5f7 30 /** @{*/
MACRUM 6:40e873bbc5f7 31
MACRUM 6:40e873bbc5f7 32 typedef enum {
MACRUM 6:40e873bbc5f7 33 FilePathType,
MACRUM 6:40e873bbc5f7 34 FileSystemPathType
MACRUM 6:40e873bbc5f7 35 } PathType;
MACRUM 6:40e873bbc5f7 36
MACRUM 6:40e873bbc5f7 37 class FileBase {
MACRUM 6:40e873bbc5f7 38 public:
MACRUM 6:40e873bbc5f7 39 FileBase(const char *name, PathType t);
MACRUM 6:40e873bbc5f7 40 virtual ~FileBase();
MACRUM 6:40e873bbc5f7 41
MACRUM 6:40e873bbc5f7 42 const char* getName(void);
MACRUM 6:40e873bbc5f7 43 PathType getPathType(void);
MACRUM 6:40e873bbc5f7 44
MACRUM 6:40e873bbc5f7 45 static FileBase *lookup(const char *name, unsigned int len);
MACRUM 6:40e873bbc5f7 46
MACRUM 6:40e873bbc5f7 47 static FileBase *get(int n);
MACRUM 6:40e873bbc5f7 48
MACRUM 6:40e873bbc5f7 49 /* disallow copy constructor and assignment operators */
MACRUM 6:40e873bbc5f7 50 private:
MACRUM 6:40e873bbc5f7 51 static FileBase *_head;
MACRUM 6:40e873bbc5f7 52 static SingletonPtr<PlatformMutex> _mutex;
MACRUM 6:40e873bbc5f7 53
MACRUM 6:40e873bbc5f7 54 FileBase *_next;
MACRUM 6:40e873bbc5f7 55 const char * const _name;
MACRUM 6:40e873bbc5f7 56 const PathType _path_type;
MACRUM 6:40e873bbc5f7 57 FileBase(const FileBase&);
MACRUM 6:40e873bbc5f7 58 FileBase & operator = (const FileBase&);
MACRUM 6:40e873bbc5f7 59 };
MACRUM 6:40e873bbc5f7 60
MACRUM 6:40e873bbc5f7 61 } // namespace mbed
MACRUM 6:40e873bbc5f7 62
MACRUM 6:40e873bbc5f7 63 #endif
MACRUM 6:40e873bbc5f7 64
MACRUM 6:40e873bbc5f7 65 /** @}*/