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  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 #ifndef MBED_FILEBASE_H
18 #define MBED_FILEBASE_H
19 
20 typedef int FILEHANDLE;
21 
22 #include "platform/platform.h"
23 #include "platform/SingletonPtr.h"
24 #include "platform/PlatformMutex.h"
25 #include "platform/NonCopyable.h"
26 
27 namespace mbed {
28 
29 typedef enum {
30  FilePathType,
31  FileSystemPathType
32 } PathType;
33 
34 /** \addtogroup platform */
35 /** @{*/
36 /**
37  * \defgroup platform_FileBase FileBase class
38  * @{
39  */
40 /** Class FileBase
41  *
42  */
43 
44 class FileBase : private NonCopyable<FileBase> {
45 public:
46  FileBase(const char *name, PathType t);
47  virtual ~FileBase();
48 
49  const char *getName(void);
50  PathType getPathType(void);
51 
52  static FileBase *lookup(const char *name, unsigned int len);
53 
54  static FileBase *get(int n);
55 
56  void set_as_default();
57 
58 private:
59  static FileBase *_head;
60  static FileBase *_default;
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 
Prevents generation of copy constructor and copy assignment operator in derived classes.
Definition: NonCopyable.h:168
Class FileBase.
Definition: FileBase.h:44
Definition: AnalogIn.h:28
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.