Home Alert System

Dependencies:   PWM_Tone_Library DHT

Committer:
ethaderu
Date:
Tue Mar 05 02:34:44 2019 +0000
Revision:
3:78f223d34f36
Publish 1

Who changed what in which revision?

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