Mistake on this page?
Report an issue in GitHub or email us
FileBase.h
1 /* mbed Microcontroller Library
2  * Copyright (c) 2006-2019 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 /** \defgroup platform-public-api-file File
35  * \ingroup platform-public-api
36  */
37 
38 /**
39  * \defgroup platform_FileBase FileBase class
40  * \ingroup platform-public-api-file
41  * @{
42  */
43 
44 /** Class FileBase
45  *
46  */
47 
48 class FileBase : private NonCopyable<FileBase> {
49 public:
50  FileBase(const char *name, PathType t);
51  virtual ~FileBase();
52 
53  const char *getName(void);
54  PathType getPathType(void);
55 
56  static FileBase *lookup(const char *name, unsigned int len);
57 
58  static FileBase *get(int n);
59 
60  void set_as_default();
61 
62 private:
63  static FileBase *_head;
64  static FileBase *_default;
65  static SingletonPtr<PlatformMutex> _mutex;
66 
67  FileBase *_next;
68  const char *const _name;
69  const PathType _path_type;
70 };
71 
72 /**@}*/
73 
74 } // namespace mbed
75 
76 #endif
Prevents generation of copy constructor and copy assignment operator in derived classes.
Definition: NonCopyable.h:169
Class FileBase.
Definition: FileBase.h:48
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.