Skip to content

Commit 307bdd7

Browse files
authored
Merge pull request #9305 from davidsaada/david_littlefs_fatfs_doxy_fix
Minor Doxygen fixes for all file system classes
2 parents d92febe + 3c7924a commit 307bdd7

File tree

3 files changed

+271
-267
lines changed

3 files changed

+271
-267
lines changed

features/storage/filesystem/FileSystem.h

Lines changed: 106 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@
2626
#include "BlockDevice.h"
2727

2828
namespace mbed {
29-
/** \addtogroup filesystem */
29+
/** \addtogroup file system */
3030
/** @{*/
3131

3232

33-
// Opaque pointer representing files and directories
33+
// Opaque pointer representing files and directories.
3434
typedef void *fs_file_t;
3535
typedef void *fs_dir_t;
3636

37-
// Predeclared classes
37+
// Predeclared classes.
3838
class Dir;
3939
class File;
4040

41-
/** A filesystem object provides filesystem operations and file operations
41+
/** A file system object. Provides file system operations and file operations
4242
* for the File and Dir classes on a block device.
4343
*
4444
* Implementations must provide at minimum file operations and mount
@@ -49,174 +49,174 @@ class File;
4949
class FileSystem : public FileSystemLike {
5050
public:
5151

52-
/** FileSystem lifetime
52+
/** File system lifetime.
5353
*
54-
* @param name Name to add filesystem to tree as
54+
* @param name Name to add file system to tree as.
5555
*/
5656
FileSystem(const char *name = NULL);
5757
virtual ~FileSystem() {}
5858

59-
/** Return the default filesystem
59+
/** Return the default file system.
6060
*
61-
* Returns the default FileSystem base on the default BlockDevice configuration.
61+
* Returns the default file system based on the default block device configuration.
6262
* Use the components in target.json or application config to change
6363
* the default block device and affect the default filesystem.
6464
* SD block device => FAT filesystem
65-
* SPIF block device => LITTLE filesystem
66-
* DATAFLASH block device => LITTLE filesystem
65+
* QSPIF, SPIF, DATAFLASH or FLAHIAP block device => LITTLE filesystem
6766
*
6867
* An application can override all target settings by implementing
69-
* FileSystem::get_default_instance() themselves - the default
68+
* FileSystem::get_default_instance() - the default
7069
* definition is weak, and calls get_target_default_instance().
7170
*/
7271
static FileSystem *get_default_instance();
7372

74-
/** Mounts a filesystem to a block device
73+
/** Mount a file system to a block device.
7574
*
76-
* @param bd BlockDevice to mount to
77-
* @return 0 on success, negative error code on failure
75+
* @param bd Block device to mount to.
76+
* @return 0 on success, negative error code on failure.
7877
*/
7978
virtual int mount(BlockDevice *bd) = 0;
8079

81-
/** Unmounts a filesystem from the underlying block device
80+
/** Unmount a file system from the underlying block device.
8281
*
83-
* @return 0 on success, negative error code on failure
82+
* @return 0 on success, negative error code on failure.
8483
*/
8584
virtual int unmount() = 0;
8685

87-
/** Reformats a filesystem, results in an empty and mounted filesystem
86+
/** Reformat a file system. Results in an empty and mounted file system.
8887
*
89-
* @param bd BlockDevice to reformat and mount. If NULL, the mounted
90-
* block device will be used.
91-
* Note: if mount fails, bd must be provided.
88+
* @param bd Block device to reformat and mount. If NULL, the mounted
89+
* Block device is used.
90+
* Note: If mount fails, bd must be provided.
9291
* Default: NULL
93-
* @return 0 on success, negative error code on failure
92+
* @return 0 on success, negative error code on failure.
9493
*/
9594
virtual int reformat(BlockDevice *bd = NULL);
9695

97-
/** Remove a file from the filesystem.
96+
/** Remove a file from the file system.
9897
*
9998
* @param path The name of the file to remove.
100-
* @return 0 on success, negative error code on failure
99+
* @return 0 on success, negative error code on failure.
101100
*/
102101
virtual int remove(const char *path);
103102

104-
/** Rename a file in the filesystem.
103+
/** Rename a file in the file system.
105104
*
106-
* @param path The name of the file to rename.
107-
* @param newpath The name to rename it to
108-
* @return 0 on success, negative error code on failure
105+
* @param path The existing name of the file to rename.
106+
* @param newpath The new name of the file.
107+
* @return 0 on success, negative error code on failure.
109108
*/
110109
virtual int rename(const char *path, const char *newpath);
111110

112-
/** Store information about the file in a stat structure
111+
/** Store information about the file in a stat structure.
113112
*
114-
* @param path The name of the file to find information about
115-
* @param st The stat buffer to write to
116-
* @return 0 on success, negative error code on failure
113+
* @param path The name of the file to find information about.
114+
* @param st The stat buffer to write to.
115+
* @return 0 on success, negative error code on failure.
117116
*/
118117
virtual int stat(const char *path, struct stat *st);
119118

120-
/** Create a directory in the filesystem.
119+
/** Create a directory in the file system.
121120
*
122121
* @param path The name of the directory to create.
123-
* @param mode The permissions with which to create the directory
124-
* @return 0 on success, negative error code on failure
122+
* @param mode The permissions with which to create the directory.
123+
* @return 0 on success, negative error code on failure.
125124
*/
126125
virtual int mkdir(const char *path, mode_t mode);
127126

128-
/** Store information about the mounted filesystem in a statvfs structure
127+
/** Store information about the mounted file system in a statvfs structure.
129128
*
130-
* @param path The name of the file to find information about
131-
* @param buf The stat buffer to write to
132-
* @return 0 on success, negative error code on failure
129+
* @param path The name of the file to find information about.
130+
* @param buf The stat buffer to write to.
131+
* @return 0 on success, negative error code on failure.
133132
*/
134133
virtual int statvfs(const char *path, struct statvfs *buf);
135134

136135
protected:
137136
friend class File;
138137
friend class Dir;
139138

140-
/** Open a file on the filesystem
139+
#if !(DOXYGEN_ONLY)
140+
/** Open a file on the file system.
141141
*
142-
* @param file Destination for the handle to a newly created file
143-
* @param path The name of the file to open
144-
* @param flags The flags to open the file in, one of O_RDONLY, O_WRONLY, O_RDWR,
145-
* bitwise or'd with one of O_CREAT, O_TRUNC, O_APPEND
146-
* @return 0 on success, negative error code on failure
142+
* @param file Destination of the newly created handle to the referenced file.
143+
* @param path The name of the file to open.
144+
* @param flags The flags that trigger opening of the file. These flags are O_RDONLY, O_WRONLY, and O_RDWR,
145+
* with an O_CREAT, O_TRUNC, or O_APPEND bitwise OR operator.
146+
* @return 0 on success, negative error code on failure.
147147
*/
148148
virtual int file_open(fs_file_t *file, const char *path, int flags) = 0;
149149

150-
/** Close a file
150+
/** Close a file.
151151
*
152-
* @param file File handle
153-
* @return 0 on success, negative error code on failure
152+
* @param file File handle.
153+
* return 0 on success, negative error code on failure.
154154
*/
155155
virtual int file_close(fs_file_t file) = 0;
156156

157-
/** Read the contents of a file into a buffer
157+
/** Read the contents of a file into a buffer.
158158
*
159-
* @param file File handle
160-
* @param buffer The buffer to read in to
161-
* @param size The number of bytes to read
162-
* @return The number of bytes read, 0 at end of file, negative error on failure
159+
* @param file File handle.
160+
* @param buffer The buffer to read in to.
161+
* @param size The number of bytes to read.
162+
* @return The number of bytes read, 0 at the end of the file, negative error on failure.
163163
*/
164164
virtual ssize_t file_read(fs_file_t file, void *buffer, size_t size) = 0;
165165

166-
/** Write the contents of a buffer to a file
166+
/** Write the contents of a buffer to a file.
167167
*
168-
* @param file File handle
169-
* @param buffer The buffer to write from
170-
* @param size The number of bytes to write
171-
* @return The number of bytes written, negative error on failure
168+
* @param file File handle.
169+
* @param buffer The buffer to write from.
170+
* @param size The number of bytes to write.
171+
* @return The number of bytes written, negative error on failure.
172172
*/
173173
virtual ssize_t file_write(fs_file_t file, const void *buffer, size_t size) = 0;
174174

175-
/** Flush any buffers associated with the file
175+
/** Flush any buffers associated with the file.
176176
*
177-
* @param file File handle
178-
* @return 0 on success, negative error code on failure
177+
* @param file File handle.
178+
* @return 0 on success, negative error code on failure.
179179
*/
180180
virtual int file_sync(fs_file_t file);
181181

182-
/** Check if the file in an interactive terminal device
183-
* If so, line buffered behaviour is used by default
182+
/** Check whether the file is an interactive terminal device.
183+
* If so, line buffered behavior is used by default.
184184
*
185-
* @param file File handle
186-
* @return True if the file is a terminal
185+
* @param file File handle.
186+
* @return True if the file is a terminal.
187187
*/
188188
virtual int file_isatty(fs_file_t file);
189189

190-
/** Move the file position to a given offset from from a given location
190+
/** Move the file position to a given offset from a given location.
191191
*
192-
* @param file File handle
193-
* @param offset The offset from whence to move to
194-
* @param whence The start of where to seek
195-
* SEEK_SET to start from beginning of file,
196-
* SEEK_CUR to start from current position in file,
197-
* SEEK_END to start from end of file
192+
* @param file File handle.
193+
* @param offset The offset from whence to move to.
194+
* @param whence The start of where to seek.
195+
* SEEK_SET to start from the beginning of the file,
196+
* SEEK_CUR to start from the current position in the file,
197+
* SEEK_END to start from the end of the file.
198198
* @return The new offset of the file
199199
*/
200200
virtual off_t file_seek(fs_file_t file, off_t offset, int whence) = 0;
201201

202-
/** Get the file position of the file
202+
/** Get the file position of the file.
203203
*
204-
* @param file File handle
205-
* @return The current offset in the file
204+
* @param file File handle.
205+
* @return The current offset in the file.
206206
*/
207207
virtual off_t file_tell(fs_file_t file);
208208

209-
/** Rewind the file position to the beginning of the file
209+
/** Rewind the file position to the beginning of the file.
210210
*
211-
* @param file File handle
211+
* @param file File handle.
212212
* @note This is equivalent to file_seek(file, 0, FS_SEEK_SET)
213213
*/
214214
virtual void file_rewind(fs_file_t file);
215215

216-
/** Get the size of the file
216+
/** Get the size of the file.
217217
*
218-
* @param file File handle
219-
* @return Size of the file in bytes
218+
* @param file File handle.
219+
* @return Size of the file in bytes.
220220
*/
221221
virtual off_t file_size(fs_file_t file);
222222

@@ -226,66 +226,67 @@ class FileSystem : public FileSystemLike {
226226
* not changed. If the file is extended, the extended area appears as if
227227
* it were zero-filled.
228228
*
229-
* @param file File handle
230-
* @param length The requested new length for the file
229+
* @param file File handle.
230+
* @param length The requested new length for the file.
231231
*
232-
* @return Zero on success, negative error code on failure
232+
* @return 0 on success, negative error code on failure.
233233
*/
234234
virtual int file_truncate(fs_file_t file, off_t length);
235235

236-
/** Open a directory on the filesystem
236+
/** Open a directory on the file system.
237237
*
238-
* @param dir Destination for the handle to the directory
239-
* @param path Name of the directory to open
240-
* @return 0 on success, negative error code on failure
238+
* @param dir Destination for the handle to the directory.
239+
* @param path Name of the directory to open.
240+
* @return 0 on success, negative error code on failure.
241241
*/
242242
virtual int dir_open(fs_dir_t *dir, const char *path);
243243

244-
/** Close a directory
244+
/** Close a directory.
245245
*
246-
* @param dir Dir handle
247-
* @return 0 on success, negative error code on failure
246+
* @param dir Dir handle.
247+
* @return 0 on success, negative error code on failure.
248248
*/
249249
virtual int dir_close(fs_dir_t dir);
250250

251-
/** Read the next directory entry
251+
/** Read the next directory entry.
252252
*
253-
* @param dir Dir handle
254-
* @param ent The directory entry to fill out
255-
* @return 1 on reading a filename, 0 at end of directory, negative error on failure
253+
* @param dir Dir handle.
254+
* @param ent The directory entry to fill out.
255+
* @return 1 on reading a filename, 0 at the end of the directory, negative error on failure.
256256
*/
257257
virtual ssize_t dir_read(fs_dir_t dir, struct dirent *ent);
258258

259-
/** Set the current position of the directory
259+
/** Set the current position of the directory.
260260
*
261-
* @param dir Dir handle
261+
* @param dir Dir handle.
262262
* @param offset Offset of the location to seek to,
263-
* must be a value returned from dir_tell
263+
* must be a value returned from dir_tell.
264264
*/
265265
virtual void dir_seek(fs_dir_t dir, off_t offset);
266266

267-
/** Get the current position of the directory
267+
/** Get the current position of the directory.
268268
*
269-
* @param dir Dir handle
270-
* @return Position of the directory that can be passed to dir_rewind
269+
* @param dir Dir handle.
270+
* @return Directory position, which can be passed to dir_rewind.
271271
*/
272272
virtual off_t dir_tell(fs_dir_t dir);
273273

274-
/** Rewind the current position to the beginning of the directory
274+
/** Rewind the current position to the beginning of the directory.
275275
*
276-
* @param dir Dir handle
276+
* @param dir Dir handle.
277277
*/
278278
virtual void dir_rewind(fs_dir_t dir);
279279

280-
/** Get the sizeof the directory
280+
/** Get the size of the directory.
281281
*
282-
* @param dir Dir handle
283-
* @return Number of files in the directory
282+
* @param dir Dir handle.
283+
* @return Number of files in the directory.
284284
*/
285285
virtual size_t dir_size(fs_dir_t dir);
286+
#endif //!defined(DOXYGEN_ONLY)
286287

287288
protected:
288-
// Hooks for FileSystemHandle
289+
// Hooks for file systemHandle
289290
virtual int open(FileHandle **file, const char *path, int flags);
290291
virtual int open(DirHandle **dir, const char *path);
291292
};

0 commit comments

Comments
 (0)