@@ -23,13 +23,11 @@ extern "C" {
23
23
#include " lfs.h"
24
24
}
25
25
26
- using namespace mbed ;
27
-
28
26
29
27
/* *
30
28
* LittleFileSystem, a little filesystem
31
29
*/
32
- class LittleFileSystem : public FileSystem {
30
+ class LittleFileSystem : public mbed :: FileSystem {
33
31
public:
34
32
/* * Lifetime of the LittleFileSystem
35
33
*
@@ -154,14 +152,14 @@ class LittleFileSystem : public FileSystem {
154
152
* bitwise or'd with one of O_CREAT, O_TRUNC, O_APPEND
155
153
* @return 0 on success, negative error code on failure
156
154
*/
157
- virtual int file_open (fs_file_t *file, const char *path, int flags);
155
+ virtual int file_open (mbed:: fs_file_t *file, const char *path, int flags);
158
156
159
157
/* * Close a file
160
158
*
161
159
* @param file File handle
162
160
* return 0 on success, negative error code on failure
163
161
*/
164
- virtual int file_close (fs_file_t file);
162
+ virtual int file_close (mbed:: fs_file_t file);
165
163
166
164
/* * Read the contents of a file into a buffer
167
165
*
@@ -170,7 +168,7 @@ class LittleFileSystem : public FileSystem {
170
168
* @param size The number of bytes to read
171
169
* @return The number of bytes read, 0 at end of file, negative error on failure
172
170
*/
173
- virtual ssize_t file_read (fs_file_t file, void *buffer, size_t size);
171
+ virtual ssize_t file_read (mbed:: fs_file_t file, void *buffer, size_t size);
174
172
175
173
/* * Write the contents of a buffer to a file
176
174
*
@@ -179,14 +177,14 @@ class LittleFileSystem : public FileSystem {
179
177
* @param size The number of bytes to write
180
178
* @return The number of bytes written, negative error on failure
181
179
*/
182
- virtual ssize_t file_write (fs_file_t file, const void *buffer, size_t size);
180
+ virtual ssize_t file_write (mbed:: fs_file_t file, const void *buffer, size_t size);
183
181
184
182
/* * Flush any buffers associated with the file
185
183
*
186
184
* @param file File handle
187
185
* @return 0 on success, negative error code on failure
188
186
*/
189
- virtual int file_sync (fs_file_t file);
187
+ virtual int file_sync (mbed:: fs_file_t file);
190
188
191
189
/* * Move the file position to a given offset from from a given location
192
190
*
@@ -198,65 +196,65 @@ class LittleFileSystem : public FileSystem {
198
196
* SEEK_END to start from end of file
199
197
* @return The new offset of the file
200
198
*/
201
- virtual off_t file_seek (fs_file_t file, off_t offset, int whence);
199
+ virtual off_t file_seek (mbed:: fs_file_t file, off_t offset, int whence);
202
200
203
201
/* * Get the file position of the file
204
202
*
205
203
* @param file File handle
206
204
* @return The current offset in the file
207
205
*/
208
- virtual off_t file_tell (fs_file_t file);
206
+ virtual off_t file_tell (mbed:: fs_file_t file);
209
207
210
208
/* * Get the size of the file
211
209
*
212
210
* @param file File handle
213
211
* @return Size of the file in bytes
214
212
*/
215
- virtual off_t file_size (fs_file_t file);
213
+ virtual off_t file_size (mbed:: fs_file_t file);
216
214
217
215
/* * Open a directory on the filesystem
218
216
*
219
217
* @param dir Destination for the handle to the directory
220
218
* @param path Name of the directory to open
221
219
* @return 0 on success, negative error code on failure
222
220
*/
223
- virtual int dir_open (fs_dir_t *dir, const char *path);
221
+ virtual int dir_open (mbed:: fs_dir_t *dir, const char *path);
224
222
225
223
/* * Close a directory
226
224
*
227
225
* @param dir Dir handle
228
226
* return 0 on success, negative error code on failure
229
227
*/
230
- virtual int dir_close (fs_dir_t dir);
228
+ virtual int dir_close (mbed:: fs_dir_t dir);
231
229
232
230
/* * Read the next directory entry
233
231
*
234
232
* @param dir Dir handle
235
233
* @param ent The directory entry to fill out
236
234
* @return 1 on reading a filename, 0 at end of directory, negative error on failure
237
235
*/
238
- virtual ssize_t dir_read (fs_dir_t dir, struct dirent *ent);
236
+ virtual ssize_t dir_read (mbed:: fs_dir_t dir, struct dirent *ent);
239
237
240
238
/* * Set the current position of the directory
241
239
*
242
240
* @param dir Dir handle
243
241
* @param offset Offset of the location to seek to,
244
242
* must be a value returned from dir_tell
245
243
*/
246
- virtual void dir_seek (fs_dir_t dir, off_t offset);
244
+ virtual void dir_seek (mbed:: fs_dir_t dir, off_t offset);
247
245
248
246
/* * Get the current position of the directory
249
247
*
250
248
* @param dir Dir handle
251
249
* @return Position of the directory that can be passed to dir_rewind
252
250
*/
253
- virtual off_t dir_tell (fs_dir_t dir);
251
+ virtual off_t dir_tell (mbed:: fs_dir_t dir);
254
252
255
253
/* * Rewind the current position to the beginning of the directory
256
254
*
257
255
* @param dir Dir handle
258
256
*/
259
- virtual void dir_rewind (fs_dir_t dir);
257
+ virtual void dir_rewind (mbed:: fs_dir_t dir);
260
258
261
259
private:
262
260
lfs_t _lfs; // _the actual filesystem
0 commit comments