diff options
| author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-02-13 22:51:21 +0200 |
|---|---|---|
| committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-02-14 19:15:21 +0200 |
| commit | e9be6a378c23ece54521fb9098fda028f6c7d88f (patch) | |
| tree | d0b712cd56c0c9602d2635336526124e9bdf223b /extmod/fsusermount.h | |
| parent | dc3eb55e6afa037e9bcea1baeb8291d17744c205 (diff) | |
extmod/vfs_fat: Object-oriented encapsulation of FatFs VFS.
This implements OO interface based on existing fsusermount code and with
minimal changes to it, to serve as a proof of concept of OO interface.
Examle of usage:
bdev = RAMFS(48)
uos.VfsFat.mkfs(bdev)
vfs = uos.VfsFat(bdev, "/ramdisk")
f = vfs.open("foo", "w")
f.write("hello!")
f.close()
Diffstat (limited to 'extmod/fsusermount.h')
| -rw-r--r-- | extmod/fsusermount.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/extmod/fsusermount.h b/extmod/fsusermount.h index 9e0d74e79..a25434b78 100644 --- a/extmod/fsusermount.h +++ b/extmod/fsusermount.h @@ -37,6 +37,7 @@ #define BP_IOCTL_SEC_SIZE (5) typedef struct _fs_user_mount_t { + mp_obj_base_t base; const char *str; uint16_t len; // length of str uint16_t flags; @@ -53,6 +54,8 @@ typedef struct _fs_user_mount_t { FATFS fatfs; } fs_user_mount_t; +fs_user_mount_t *fatfs_mount_mkfs(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args, bool mkfs); + MP_DECLARE_CONST_FUN_OBJ(fsuser_mount_obj); MP_DECLARE_CONST_FUN_OBJ(fsuser_umount_obj); MP_DECLARE_CONST_FUN_OBJ(fsuser_mkfs_obj); |
