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

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.