From 65efde2f7c635076b384b658beaceb628ad703df Mon Sep 17 00:00:00 2001 From: Sebastian Romero Date: Wed, 29 Nov 2023 17:13:51 +0100 Subject: [PATCH] Update API documentation --- docs/api.md | 723 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 542 insertions(+), 181 deletions(-) diff --git a/docs/api.md b/docs/api.md index 8245b48..d834803 100644 --- a/docs/api.md +++ b/docs/api.md @@ -19,17 +19,21 @@ Abstract class representing the common features of the supported storage methods Members | Descriptions --------------------------------|--------------------------------------------- -`public bool ` [`begin`](#class_arduino___unified_storage_1a350443027c76ea18f2812a54aa8ab437)`()` | Initializes the storage. -`public bool ` [`begin`](#class_arduino___unified_storage_1acb25f75f3dcdb89ebce3c7cd08970a99)`(FileSystems fs)` | Initializes the storage with the specified file system. -`public bool ` [`unmount`](#class_arduino___unified_storage_1a4281bc190ee4f2ad35265eab64ef6f7f)`()` | Unmounts the storage. -`public ` [`Folder`](#class_folder)` ` [`getRootFolder`](#class_arduino___unified_storage_1a7166075ba695d54bf74c6c71b8c4c1bf)`()` | Retrieves the root folder of the storage. -`public bool ` [`format`](#class_arduino___unified_storage_1ad6d045b4bdafd4dcb75daed305888e25)`(FileSystems fs)` | Formats the storage with the selected file system. -`public static void ` [`debugPrint`](#class_arduino___unified_storage_1ab0b726c7f98ea3623679097224290a07)`(String message)` | -`public static void ` [`testPrint`](#class_arduino___unified_storage_1a1fafe7a15fbd21c8705a9f86a92f6dd9)`(String message)` | +| [`begin`](#class_arduino___unified_storage_1a350443027c76ea18f2812a54aa8ab437) | Initializes the storage. | +| [`begin`](#class_arduino___unified_storage_1acb25f75f3dcdb89ebce3c7cd08970a99) | Initializes the storage with the specified file system. | +| [`unmount`](#class_arduino___unified_storage_1a4281bc190ee4f2ad35265eab64ef6f7f) | Unmounts the storage. | +| [`getRootFolder`](#class_arduino___unified_storage_1a7166075ba695d54bf74c6c71b8c4c1bf) | Retrieves the root folder of the storage. | +| [`format`](#class_arduino___unified_storage_1ad6d045b4bdafd4dcb75daed305888e25) | Formats the storage with the selected file system. | +| [`debugPrint`](#class_arduino___unified_storage_1a466b794918c895d105501507f9337e61) | | +| [`testPrint`](#class_arduino___unified_storage_1ab76317acb2bf69c6fdf7575ed317e8f2) | | ## Members -### `public bool ` [`begin`](#class_arduino___unified_storage_1a350443027c76ea18f2812a54aa8ab437)`()` +### `begin` + +```cpp +public bool begin() +``` Initializes the storage. @@ -37,7 +41,11 @@ Initializes the storage. true if successful, false if failed.
-### `public bool ` [`begin`](#class_arduino___unified_storage_1acb25f75f3dcdb89ebce3c7cd08970a99)`(FileSystems fs)` +### `begin` + +```cpp +public bool begin(FileSystems fs) +``` Initializes the storage with the specified file system. #### Parameters @@ -47,32 +55,52 @@ Initializes the storage with the specified file system. true if successful, false if failed.
-### `public bool ` [`unmount`](#class_arduino___unified_storage_1a4281bc190ee4f2ad35265eab64ef6f7f)`()` +### `unmount` + +```cpp +public bool unmount() +``` Unmounts the storage. #### Returns true if successful, false if failed.
-### `public ` [`Folder`](#class_folder)` ` [`getRootFolder`](#class_arduino___unified_storage_1a7166075ba695d54bf74c6c71b8c4c1bf)`()` +### `getRootFolder` + +```cpp +public Folder getRootFolder() +``` Retrieves the root folder of the storage. #### Returns The root folder as a [Folder](#class_folder) object.
-### `public bool ` [`format`](#class_arduino___unified_storage_1ad6d045b4bdafd4dcb75daed305888e25)`(FileSystems fs)` +### `format` + +```cpp +public bool format(FileSystems fs) +``` Formats the storage with the selected file system. #### Returns true if successful, false if failed.
-### `public static void ` [`debugPrint`](#class_arduino___unified_storage_1ab0b726c7f98ea3623679097224290a07)`(String message)` +### `debugPrint` + +```cpp +public static void debugPrint(String message) +```
-### `public static void ` [`testPrint`](#class_arduino___unified_storage_1a1fafe7a15fbd21c8705a9f86a92f6dd9)`(String message)` +### `testPrint` + +```cpp +public static void testPrint(String message) +```
@@ -84,37 +112,45 @@ Class representing a directory. Members | Descriptions --------------------------------|--------------------------------------------- -`public ` [`Folder`](#class_folder_1a8af69fd19ba86816c60b4c2291311eb1)`()` | Creates an empty [Folder](#class_folder) object. Please note that any operation on this object will fail until a valid directory is assigned to it. -`public ` [`Folder`](#class_folder_1aa2a4dc98e8c383c7b4fa503b45813fe3)`(const char * dirname)` | Creates a directory with the specified name. If the directory already exists, it returns a [Folder](#class_folder) object representing the existing directory. Otherwise, it tries to create a new directory with the specified name. If it fails the `path` property of the [Folder](#class_folder) object will be null. -`public ` [`Folder`](#class_folder_1a6f445bfe0214a03ba00a1408e41726dd)`(String dirname)` | Creates a directory with the specified name. If the directory already exists, it returns a [Folder](#class_folder) object representing the existing directory. Otherwise, it tries to create a new directory with the specified name. If it fails the `path` property of the [Folder](#class_folder) object will be empty. -`public ` [`UFile`](#class_u_file)` ` [`createFile`](#class_folder_1a04eceb0406b02e2d8a628d3c359dba5d)`(const char * fileName, FileMode fmode)` | Creates a file inside the directory. -`public ` [`UFile`](#class_u_file)` ` [`createFile`](#class_folder_1a44255e2c0c4ffa37d7637a601bc590f6)`(String fileName, FileMode fmode)` | Creates a file inside the directory. -`public bool ` [`remove`](#class_folder_1aca893daac6c6747895d50987cf9cf34c)`()` | Removes a directory. -`public bool ` [`rename`](#class_folder_1adcbb7766d628810f716887d1e7e8d36f)`(const char * newDirname)` | Renames a directory. -`public bool ` [`rename`](#class_folder_1a14519c2a344ebfb8161c2bee2a2b5464)`(String newDirname)` | Renames a directory. -`public bool ` [`exists`](#class_folder_1aa548278d3ec09fd4abcaa827a79c40f4)`()` | Checks if the directory exists. -`public const char * ` [`getPath`](#class_folder_1a731e8d84685eca8e273affba152468a6)`()` | Returns the path of the file. -`public String ` [`getPathAsString`](#class_folder_1ac816d0fe5674c4648e97423b6f9c51f8)`()` | Returns the path of the file. -`public ` [`Folder`](#class_folder)` ` [`createSubfolder`](#class_folder_1a78f2f9b297f62b67c2e0656b15a95868)`(const char * subfolderName, bool overwrite)` | Creates a subfolder in the directory. -`public ` [`Folder`](#class_folder)` ` [`createSubfolder`](#class_folder_1ab50743664becb7b2a1fb564b5513d69c)`(String subfolderName, bool overwrite)` | Creates a subfolder in the directory. -`public std::vector< ` [`UFile`](#class_u_file)` > ` [`getFiles`](#class_folder_1a3c2e01e19b48e3aa709cbdbb0acbdd78)`()` | Returns File objects for all files in the current directory. -`public std::vector< ` [`Folder`](#class_folder)` > ` [`getFolders`](#class_folder_1a69d3df42dacbd1d64d0f527e090f1fbb)`()` | Returns [Folder](#class_folder) objects for all files in the current directory. -`public bool ` [`copyTo`](#class_folder_1aabf0818b7ee45b2d871e82e86edb4ebd)`(` [`Folder`](#class_folder)` destination, bool overwrite)` | Copies the current directory. -`public bool ` [`copyTo`](#class_folder_1a058d193f53c559eefe343b30797500eb)`(const char * destination, bool overwrite)` | Copies the current directory. -`public bool ` [`copyTo`](#class_folder_1a3162979e4c679c7f5503cc4584949714)`(String destination, bool overwrite)` | Copies the current directory. -`public bool ` [`moveTo`](#class_folder_1a5002b388b7e503ba79a8623ca6c1cbbd)`(` [`Folder`](#class_folder)` destination, bool overwrite)` | Moves the current directory. -`public bool ` [`moveTo`](#class_folder_1a0ab690abfff790a2bd9fff3dd5976e82)`(const char * destination, bool overwrite)` | Moves the current directory. -`public bool ` [`moveTo`](#class_folder_1a3125db272185165a03b891efe5985a32)`(String destination, bool overwrite)` | Move the current directory. +| [`Folder`](#class_folder_1a8af69fd19ba86816c60b4c2291311eb1) | Creates an empty [Folder](#class_folder) object. Please note that any operation on this object will fail until a valid directory is assigned to it. | +| [`Folder`](#class_folder_1aa2a4dc98e8c383c7b4fa503b45813fe3) | Creates a directory with the specified name. If the directory already exists, it returns a [Folder](#class_folder) object representing the existing directory. Otherwise, it tries to create a new directory with the specified name. If it fails the `path` property of the [Folder](#class_folder) object will be null. | +| [`Folder`](#class_folder_1a6f445bfe0214a03ba00a1408e41726dd) | Creates a directory with the specified name. If the directory already exists, it returns a [Folder](#class_folder) object representing the existing directory. Otherwise, it tries to create a new directory with the specified name. If it fails the `path` property of the [Folder](#class_folder) object will be empty. | +| [`createFile`](#class_folder_1a04eceb0406b02e2d8a628d3c359dba5d) | Creates a file inside the directory. | +| [`createFile`](#class_folder_1a44255e2c0c4ffa37d7637a601bc590f6) | Creates a file inside the directory. | +| [`remove`](#class_folder_1aca893daac6c6747895d50987cf9cf34c) | Removes a directory. | +| [`rename`](#class_folder_1adcbb7766d628810f716887d1e7e8d36f) | Renames a directory. | +| [`rename`](#class_folder_1a14519c2a344ebfb8161c2bee2a2b5464) | Renames a directory. | +| [`exists`](#class_folder_1aa548278d3ec09fd4abcaa827a79c40f4) | Checks if the directory exists. | +| [`getPath`](#class_folder_1a0ef68289c526f8bf24020389c4e09e86) | Returns the path of the file. | +| [`getPathAsString`](#class_folder_1ac816d0fe5674c4648e97423b6f9c51f8) | Returns the path of the file. | +| [`createSubfolder`](#class_folder_1a78f2f9b297f62b67c2e0656b15a95868) | Creates a subfolder in the directory. | +| [`createSubfolder`](#class_folder_1ab50743664becb7b2a1fb564b5513d69c) | Creates a subfolder in the directory. | +| [`getFiles`](#class_folder_1a2e7f604d19b8ad61524f86ade86ed4ad) | Returns File objects for all files in the current directory. | +| [`getFolders`](#class_folder_1a5554b8cc2fd1ca39dfccbd06bc635e10) | Returns [Folder](#class_folder) objects for all files in the current directory. | +| [`copyTo`](#class_folder_1aabf0818b7ee45b2d871e82e86edb4ebd) | Copies the current directory. | +| [`copyTo`](#class_folder_1a058d193f53c559eefe343b30797500eb) | Copies the current directory. | +| [`copyTo`](#class_folder_1a3162979e4c679c7f5503cc4584949714) | Copies the current directory. | +| [`moveTo`](#class_folder_1a5002b388b7e503ba79a8623ca6c1cbbd) | Moves the current directory. | +| [`moveTo`](#class_folder_1a0ab690abfff790a2bd9fff3dd5976e82) | Moves the current directory. | +| [`moveTo`](#class_folder_1a3125db272185165a03b891efe5985a32) | Move the current directory. | ## Members -### `public ` [`Folder`](#class_folder_1a8af69fd19ba86816c60b4c2291311eb1)`()` +### `Folder` + +```cpp +public Folder() +``` Creates an empty [Folder](#class_folder) object. Please note that any operation on this object will fail until a valid directory is assigned to it.
-### `public ` [`Folder`](#class_folder_1aa2a4dc98e8c383c7b4fa503b45813fe3)`(const char * dirname)` +### `Folder` + +```cpp +public Folder(const char * dirname) +``` Creates a directory with the specified name. If the directory already exists, it returns a [Folder](#class_folder) object representing the existing directory. Otherwise, it tries to create a new directory with the specified name. If it fails the `path` property of the [Folder](#class_folder) object will be null. @@ -122,7 +158,11 @@ Creates a directory with the specified name. If the directory already exists, it * `const` char * dirname - The name of the directory.
-### `public ` [`Folder`](#class_folder_1a6f445bfe0214a03ba00a1408e41726dd)`(String dirname)` +### `Folder` + +```cpp +public Folder(String dirname) +``` Creates a directory with the specified name. If the directory already exists, it returns a [Folder](#class_folder) object representing the existing directory. Otherwise, it tries to create a new directory with the specified name. If it fails the `path` property of the [Folder](#class_folder) object will be empty. @@ -130,7 +170,11 @@ Creates a directory with the specified name. If the directory already exists, it * `String` dirname - The name of the directory.
-### `public ` [`UFile`](#class_u_file)` ` [`createFile`](#class_folder_1a04eceb0406b02e2d8a628d3c359dba5d)`(const char * fileName, FileMode fmode)` +### `createFile` + +```cpp +public UFile createFile(const char * fileName, FileMode fmode) +``` Creates a file inside the directory. @@ -141,7 +185,11 @@ Creates a file inside the directory. A File object if successful, NULL if not.
-### `public ` [`UFile`](#class_u_file)` ` [`createFile`](#class_folder_1a44255e2c0c4ffa37d7637a601bc590f6)`(String fileName, FileMode fmode)` +### `createFile` + +```cpp +public UFile createFile(String fileName, FileMode fmode) +``` Creates a file inside the directory. @@ -152,7 +200,11 @@ Creates a file inside the directory. A File object if successful, NULL if not.
-### `public bool ` [`remove`](#class_folder_1aca893daac6c6747895d50987cf9cf34c)`()` +### `remove` + +```cpp +public bool remove() +``` Removes a directory. @@ -163,7 +215,11 @@ Removes a directory. True if the directory was removed successfully, false otherwise.
-### `public bool ` [`rename`](#class_folder_1adcbb7766d628810f716887d1e7e8d36f)`(const char * newDirname)` +### `rename` + +```cpp +public bool rename(const char * newDirname) +``` Renames a directory. @@ -174,7 +230,11 @@ Renames a directory. True if the directory was renamed successfully, false otherwise.
-### `public bool ` [`rename`](#class_folder_1a14519c2a344ebfb8161c2bee2a2b5464)`(String newDirname)` +### `rename` + +```cpp +public bool rename(String newDirname) +``` Renames a directory. @@ -185,7 +245,11 @@ Renames a directory. True if the directory was renamed successfully, false otherwise.
-### `public bool ` [`exists`](#class_folder_1aa548278d3ec09fd4abcaa827a79c40f4)`()` +### `exists` + +```cpp +public bool exists() +``` Checks if the directory exists. @@ -193,7 +257,11 @@ Checks if the directory exists. True if the directory exists, false otherwise.
-### `public const char * ` [`getPath`](#class_folder_1a731e8d84685eca8e273affba152468a6)`()` +### `getPath` + +```cpp +public const char * getPath() +``` Returns the path of the file. @@ -201,7 +269,11 @@ Returns the path of the file. The path of the file as a const char *
-### `public String ` [`getPathAsString`](#class_folder_1ac816d0fe5674c4648e97423b6f9c51f8)`()` +### `getPathAsString` + +```cpp +public String getPathAsString() +``` Returns the path of the file. @@ -209,7 +281,11 @@ Returns the path of the file. The path of the file as an Arduino String
-### `public ` [`Folder`](#class_folder)` ` [`createSubfolder`](#class_folder_1a78f2f9b297f62b67c2e0656b15a95868)`(const char * subfolderName, bool overwrite)` +### `createSubfolder` + +```cpp +public Folder createSubfolder(const char * subfolderName, bool overwrite) +``` Creates a subfolder in the directory. @@ -222,7 +298,11 @@ Creates a subfolder in the directory. The created subfolder.
-### `public ` [`Folder`](#class_folder)` ` [`createSubfolder`](#class_folder_1ab50743664becb7b2a1fb564b5513d69c)`(String subfolderName, bool overwrite)` +### `createSubfolder` + +```cpp +public Folder createSubfolder(String subfolderName, bool overwrite) +``` Creates a subfolder in the directory. @@ -235,7 +315,11 @@ Creates a subfolder in the directory. The created subfolder.
-### `public std::vector< ` [`UFile`](#class_u_file)` > ` [`getFiles`](#class_folder_1a3c2e01e19b48e3aa709cbdbb0acbdd78)`()` +### `getFiles` + +```cpp +public std::vector< UFile > getFiles() +``` Returns File objects for all files in the current directory. @@ -243,7 +327,11 @@ Returns File objects for all files in the current directory. A std::vector of File objects representing the files in the directory.
-### `public std::vector< ` [`Folder`](#class_folder)` > ` [`getFolders`](#class_folder_1a69d3df42dacbd1d64d0f527e090f1fbb)`()` +### `getFolders` + +```cpp +public std::vector< Folder > getFolders() +``` Returns [Folder](#class_folder) objects for all files in the current directory. @@ -251,7 +339,11 @@ Returns [Folder](#class_folder) objects for all files in the current directory. A std::vector of [Folder](#class_folder) objects representing the files in the directory.
-### `public bool ` [`copyTo`](#class_folder_1aabf0818b7ee45b2d871e82e86edb4ebd)`(` [`Folder`](#class_folder)` destination, bool overwrite)` +### `copyTo` + +```cpp +public bool copyTo( Folder destination, bool overwrite) +``` Copies the current directory. @@ -262,7 +354,11 @@ Copies the current directory. True upon success, false otherwise.
-### `public bool ` [`copyTo`](#class_folder_1a058d193f53c559eefe343b30797500eb)`(const char * destination, bool overwrite)` +### `copyTo` + +```cpp +public bool copyTo(const char * destination, bool overwrite) +``` Copies the current directory. @@ -275,7 +371,11 @@ Copies the current directory. True upon success, false otherwise.
-### `public bool ` [`copyTo`](#class_folder_1a3162979e4c679c7f5503cc4584949714)`(String destination, bool overwrite)` +### `copyTo` + +```cpp +public bool copyTo(String destination, bool overwrite) +``` Copies the current directory. @@ -288,7 +388,11 @@ Copies the current directory. True upon success, false otherwise.
-### `public bool ` [`moveTo`](#class_folder_1a5002b388b7e503ba79a8623ca6c1cbbd)`(` [`Folder`](#class_folder)` destination, bool overwrite)` +### `moveTo` + +```cpp +public bool moveTo( Folder destination, bool overwrite) +``` Moves the current directory. @@ -301,7 +405,11 @@ Moves the current directory. True upon success, false otherwise.
-### `public bool ` [`moveTo`](#class_folder_1a0ab690abfff790a2bd9fff3dd5976e82)`(const char * destination, bool overwrite)` +### `moveTo` + +```cpp +public bool moveTo(const char * destination, bool overwrite) +``` Moves the current directory. @@ -314,7 +422,11 @@ Moves the current directory. True upon success, false otherwise.
-### `public bool ` [`moveTo`](#class_folder_1a3125db272185165a03b891efe5985a32)`(String destination, bool overwrite)` +### `moveTo` + +```cpp +public bool moveTo(String destination, bool overwrite) +``` Move the current directory. @@ -340,27 +452,35 @@ Represents internal storage using the Arduino Unified Storage library. Members | Descriptions --------------------------------|--------------------------------------------- -`public ` [`InternalStorage`](#class_internal_storage_1ac45948ef554bc659efed81240140192e)`()` | Constructs an [InternalStorage](#class_internal_storage) object with default settings. If no partitions are available, it restores the default partitioning scheme (See [restoreDefaultPartitions()](#class_internal_storage_1ace77d2372832c2f9ef39d382cc443259) for more info). If partitions are available, it sets the partition number, file system type, and partition name based on the last partition available. When using the default partitioning scheme the last partition would be the user partition. -`public ` [`InternalStorage`](#class_internal_storage_1ac13cad019a2ae66647d1c3604690eca7)`(int partition, const char * name, FileSystems fs)` | Constructs an [InternalStorage](#class_internal_storage) object with the specified partition, name, and file system. -`public virtual bool ` [`begin`](#class_internal_storage_1a984731348dfbdade84e24250133a033e)`()` | Initializes the internal storage. -`public virtual bool ` [`begin`](#class_internal_storage_1a90cd409874d9c578ce3add4df88875e5)`(FileSystems fs)` | Initializes the internal storage with the specified file system. -`public virtual bool ` [`unmount`](#class_internal_storage_1a663446e2135a4e91d7fdb8ca638cc027)`()` | Unmounts the internal storage. -`public virtual ` [`Folder`](#class_folder)` ` [`getRootFolder`](#class_internal_storage_1a87142ddbdad62217e33851b32572082d)`()` | Retrieves the root folder of the internal storage. -`public virtual bool ` [`format`](#class_internal_storage_1a9ee819a55de5d411e6b10bdc9942c601)`(FileSystems fs)` | Formats the internal storage with the selected file system. -`public BlockDeviceType * ` [`getBlockDevice`](#class_internal_storage_1a499c1975764c56ad3770ef9c582d7dda)`()` | Retrieves the block device associated with the internal storage. -`public static bool ` [`partition`](#class_internal_storage_1acd4f9617061b962f38b20a4c6ddb8d48)`(std::vector< ` [`Partition`](#struct_partition)` > partitions)` | Partitions the internal storage according to the partitioning scheme given in the `partitions` parameter erasing the existing partitions -`public static bool ` [`partition`](#class_internal_storage_1aefb31c03b94006e75b18111f07c99331)`()` | Creates one partition spanning over the whole size of the internal storage drive erasing the existing partitions. -`public static bool ` [`restoreDefaultPartitions`](#class_internal_storage_1ace77d2372832c2f9ef39d382cc443259)`()` | Restores the default partitioning scheme (1MB FAT32 for Certificates, 5MB FAT32 for OTA, 8MB user storage) to the internal storage drive erasing the existing partitions. -`public static std::vector< ` [`Partition`](#struct_partition)` > ` [`readPartitions`](#class_internal_storage_1a7191c21a719e9fe8132dc3cfaed3f0ec)`()` | Reads the partitioning scheme from the MBR sector of the internal storage drive and returns a vector of structs of type [Partition](#struct_partition) that represents the partitioning scheme +| [`InternalStorage`](#class_internal_storage_1ac45948ef554bc659efed81240140192e) | Constructs an [InternalStorage](#class_internal_storage) object with default settings. If no partitions are available, it restores the default partitioning scheme (See [restoreDefaultPartitions()](#class_internal_storage_1aa437dd0c91b3481f93fcd8239ed6dc82) for more info). If partitions are available, it sets the partition number, file system type, and partition name based on the last partition available. When using the default partitioning scheme the last partition would be the user partition. | +| [`InternalStorage`](#class_internal_storage_1ac13cad019a2ae66647d1c3604690eca7) | Constructs an [InternalStorage](#class_internal_storage) object with the specified partition, name, and file system. | +| [`begin`](#class_internal_storage_1a984731348dfbdade84e24250133a033e) | Initializes the internal storage. | +| [`begin`](#class_internal_storage_1a90cd409874d9c578ce3add4df88875e5) | Initializes the internal storage with the specified file system. | +| [`unmount`](#class_internal_storage_1a663446e2135a4e91d7fdb8ca638cc027) | Unmounts the internal storage. | +| [`getRootFolder`](#class_internal_storage_1a87142ddbdad62217e33851b32572082d) | Retrieves the root folder of the internal storage. | +| [`format`](#class_internal_storage_1a9ee819a55de5d411e6b10bdc9942c601) | Formats the internal storage with the selected file system. | +| [`getBlockDevice`](#class_internal_storage_1af347558e09045a5dd868f93b24286bab) | Retrieves the block device associated with the internal storage. | +| [`partition`](#class_internal_storage_1aa184679273e351e17a3a713d36aba6aa) | Partitions the internal storage according to the partitioning scheme given in the `partitions` parameter erasing the existing partitions | +| [`partition`](#class_internal_storage_1a6e9670923ace01a0ffba456ae460b1bb) | Creates one partition spanning over the whole size of the internal storage drive erasing the existing partitions. | +| [`restoreDefaultPartitions`](#class_internal_storage_1aa437dd0c91b3481f93fcd8239ed6dc82) | Restores the default partitioning scheme (1MB FAT32 for Certificates, 5MB FAT32 for OTA, 8MB user storage) to the internal storage drive erasing the existing partitions. | +| [`readPartitions`](#class_internal_storage_1a044927dfb048440a9c73985af9c3cf80) | Reads the partitioning scheme from the MBR sector of the internal storage drive and returns a vector of structs of type [Partition](#struct_partition) that represents the partitioning scheme | ## Members -### `public ` [`InternalStorage`](#class_internal_storage_1ac45948ef554bc659efed81240140192e)`()` +### `InternalStorage` + +```cpp +public InternalStorage() +``` -Constructs an [InternalStorage](#class_internal_storage) object with default settings. If no partitions are available, it restores the default partitioning scheme (See [restoreDefaultPartitions()](#class_internal_storage_1ace77d2372832c2f9ef39d382cc443259) for more info). If partitions are available, it sets the partition number, file system type, and partition name based on the last partition available. When using the default partitioning scheme the last partition would be the user partition. +Constructs an [InternalStorage](#class_internal_storage) object with default settings. If no partitions are available, it restores the default partitioning scheme (See [restoreDefaultPartitions()](#class_internal_storage_1aa437dd0c91b3481f93fcd8239ed6dc82) for more info). If partitions are available, it sets the partition number, file system type, and partition name based on the last partition available. When using the default partitioning scheme the last partition would be the user partition.
-### `public ` [`InternalStorage`](#class_internal_storage_1ac13cad019a2ae66647d1c3604690eca7)`(int partition, const char * name, FileSystems fs)` +### `InternalStorage` + +```cpp +public InternalStorage(int partition, const char * name, FileSystems fs) +``` Constructs an [InternalStorage](#class_internal_storage) object with the specified partition, name, and file system. @@ -372,7 +492,11 @@ Constructs an [InternalStorage](#class_internal_storage) object with the specifi * `fs` The desired file system (FS_FAT or FS_LITTLEFS).
-### `public virtual bool ` [`begin`](#class_internal_storage_1a984731348dfbdade84e24250133a033e)`()` +### `begin` + +```cpp +public virtual bool begin() +``` Initializes the internal storage. @@ -380,7 +504,11 @@ Initializes the internal storage. true if successful, false if failed.
-### `public virtual bool ` [`begin`](#class_internal_storage_1a90cd409874d9c578ce3add4df88875e5)`(FileSystems fs)` +### `begin` + +```cpp +public virtual bool begin(FileSystems fs) +``` Initializes the internal storage with the specified file system. @@ -391,7 +519,11 @@ Initializes the internal storage with the specified file system. true if successful, false if failed.
-### `public virtual bool ` [`unmount`](#class_internal_storage_1a663446e2135a4e91d7fdb8ca638cc027)`()` +### `unmount` + +```cpp +public virtual bool unmount() +``` Unmounts the internal storage. @@ -399,7 +531,11 @@ Unmounts the internal storage. true if successful, false if failed.
-### `public virtual ` [`Folder`](#class_folder)` ` [`getRootFolder`](#class_internal_storage_1a87142ddbdad62217e33851b32572082d)`()` +### `getRootFolder` + +```cpp +public virtual Folder getRootFolder() +``` Retrieves the root folder of the internal storage. @@ -407,7 +543,11 @@ Retrieves the root folder of the internal storage. The root folder as a [Folder](#class_folder) object.
-### `public virtual bool ` [`format`](#class_internal_storage_1a9ee819a55de5d411e6b10bdc9942c601)`(FileSystems fs)` +### `format` + +```cpp +public virtual bool format(FileSystems fs) +``` Formats the internal storage with the selected file system. @@ -415,7 +555,11 @@ Formats the internal storage with the selected file system. true if successful, false if failed.
-### `public BlockDeviceType * ` [`getBlockDevice`](#class_internal_storage_1a499c1975764c56ad3770ef9c582d7dda)`()` +### `getBlockDevice` + +```cpp +public BlockDeviceType * getBlockDevice() +``` Retrieves the block device associated with the internal storage. @@ -423,7 +567,11 @@ Retrieves the block device associated with the internal storage. The block device as a BlockDevice object.
-### `public static bool ` [`partition`](#class_internal_storage_1acd4f9617061b962f38b20a4c6ddb8d48)`(std::vector< ` [`Partition`](#struct_partition)` > partitions)` +### `partition` + +```cpp +public static bool partition(std::vector< Partition > partitions) +``` Partitions the internal storage according to the partitioning scheme given in the `partitions` parameter erasing the existing partitions #### Parameters @@ -433,21 +581,33 @@ Partitions the internal storage according to the partitioning scheme given in th true if successful, false if failed.
-### `public static bool ` [`partition`](#class_internal_storage_1aefb31c03b94006e75b18111f07c99331)`()` +### `partition` + +```cpp +public static bool partition() +``` Creates one partition spanning over the whole size of the internal storage drive erasing the existing partitions. #### Returns true if successful, false if failed.
-### `public static bool ` [`restoreDefaultPartitions`](#class_internal_storage_1ace77d2372832c2f9ef39d382cc443259)`()` +### `restoreDefaultPartitions` + +```cpp +public static bool restoreDefaultPartitions() +``` Restores the default partitioning scheme (1MB FAT32 for Certificates, 5MB FAT32 for OTA, 8MB user storage) to the internal storage drive erasing the existing partitions. #### Returns true if successful, false if failed.
-### `public static std::vector< ` [`Partition`](#struct_partition)` > ` [`readPartitions`](#class_internal_storage_1a7191c21a719e9fe8132dc3cfaed3f0ec)`()` +### `readPartitions` + +```cpp +public static std::vector< Partition > readPartitions() +``` Reads the partitioning scheme from the MBR sector of the internal storage drive and returns a vector of structs of type [Partition](#struct_partition) that represents the partitioning scheme #### Returns @@ -460,13 +620,17 @@ vector of structs of type [Partition](#struct_partition) Members | Descriptions --------------------------------|--------------------------------------------- -`public static bool ` [`eraseMBRSector`](#class_partitioning_1a662f276b27785e76cdf9f89c5356e784)`(BlockDeviceType * blockDevice)` | Erases the first block (4096 bytes) of the BlockDevice to delete any already existing MBR partition table -`public static bool ` [`partitionDrive`](#class_partitioning_1a803b6e9a67304c6551d2a90ed5473985)`(BlockDeviceType * blockDevice, std::vector< ` [`Partition`](#struct_partition)` > partitions)` | Partitions the BlockDevice according to the partitioning schemme given by the vector of [Partition](#struct_partition) structs -`public static std::vector< ` [`Partition`](#struct_partition)` > ` [`readPartitions`](#class_partitioning_1a44886fc5c7320a07cc42171ce9581fec)`(BlockDeviceType * blockDevice)` | Reads and unpacks the MBR partition information and returns a list of partitions it can find on the drive +| [`eraseMBRSector`](#class_partitioning_1a21c0af41e2f29f3290dee36eb0f0d0b7) | Erases the first block (4096 bytes) of the BlockDevice to delete any already existing MBR partition table | +| [`partitionDrive`](#class_partitioning_1a450e1491d5d58d5d082dba6d45561b0f) | Partitions the BlockDevice according to the partitioning schemme given by the vector of [Partition](#struct_partition) structs | +| [`readPartitions`](#class_partitioning_1a21af9f41711668d2f80fb0c74ce9168f) | Reads and unpacks the MBR partition information and returns a list of partitions it can find on the drive | ## Members -### `public static bool ` [`eraseMBRSector`](#class_partitioning_1a662f276b27785e76cdf9f89c5356e784)`(BlockDeviceType * blockDevice)` +### `eraseMBRSector` + +```cpp +public static bool eraseMBRSector(BlockDeviceType * blockDevice) +``` Erases the first block (4096 bytes) of the BlockDevice to delete any already existing MBR partition table #### Parameters @@ -476,7 +640,11 @@ Erases the first block (4096 bytes) of the BlockDevice to delete any already exi True upon success, False on failure
-### `public static bool ` [`partitionDrive`](#class_partitioning_1a803b6e9a67304c6551d2a90ed5473985)`(BlockDeviceType * blockDevice, std::vector< ` [`Partition`](#struct_partition)` > partitions)` +### `partitionDrive` + +```cpp +public static bool partitionDrive(BlockDeviceType * blockDevice, std::vector< Partition > partitions) +``` Partitions the BlockDevice according to the partitioning schemme given by the vector of [Partition](#struct_partition) structs #### Parameters @@ -488,7 +656,11 @@ Partitions the BlockDevice according to the partitioning schemme given by the ve True upon success, False on failure
-### `public static std::vector< ` [`Partition`](#struct_partition)` > ` [`readPartitions`](#class_partitioning_1a44886fc5c7320a07cc42171ce9581fec)`(BlockDeviceType * blockDevice)` +### `readPartitions` + +```cpp +public static std::vector< Partition > readPartitions(BlockDeviceType * blockDevice) +``` Reads and unpacks the MBR partition information and returns a list of partitions it can find on the drive #### Parameters @@ -511,21 +683,29 @@ Represents an SD card storage using the Arduino Unified Storage library. Members | Descriptions --------------------------------|--------------------------------------------- -`public ` [`SDStorage`](#class_s_d_storage_1a992cb710f41462a7a35c6dfdc838f01f)`()` | Default constructor for the [SDStorage](#class_s_d_storage) class. -`public virtual bool ` [`begin`](#class_s_d_storage_1ab49c772b785b6c97940baca60ae386ec)`()` | Initializes the SD card storage. -`public virtual bool ` [`begin`](#class_s_d_storage_1a19520df98c5a52d403ac26a873f65860)`(FileSystems fs)` | Initializes the SD card storage with the specified file system. -`public virtual bool ` [`unmount`](#class_s_d_storage_1a6f4d671e685d660d0aff8648d8288b9c)`()` | Unmounts the SD card storage. -`public virtual ` [`Folder`](#class_folder)` ` [`getRootFolder`](#class_s_d_storage_1a2f7327c327985d88bd1305310ec0c5e8)`()` | Retrieves the root folder of the SD card storage. -`public virtual bool ` [`format`](#class_s_d_storage_1a93cac8330a5950138985e3712db1dc07)`(FileSystems fs)` | Formats the SD card storage with the selected file system. +| [`SDStorage`](#class_s_d_storage_1a992cb710f41462a7a35c6dfdc838f01f) | Default constructor for the [SDStorage](#class_s_d_storage) class. | +| [`begin`](#class_s_d_storage_1ab49c772b785b6c97940baca60ae386ec) | Initializes the SD card storage. | +| [`begin`](#class_s_d_storage_1a19520df98c5a52d403ac26a873f65860) | Initializes the SD card storage with the specified file system. | +| [`unmount`](#class_s_d_storage_1a6f4d671e685d660d0aff8648d8288b9c) | Unmounts the SD card storage. | +| [`getRootFolder`](#class_s_d_storage_1a2f7327c327985d88bd1305310ec0c5e8) | Retrieves the root folder of the SD card storage. | +| [`format`](#class_s_d_storage_1a93cac8330a5950138985e3712db1dc07) | Formats the SD card storage with the selected file system. | ## Members -### `public ` [`SDStorage`](#class_s_d_storage_1a992cb710f41462a7a35c6dfdc838f01f)`()` +### `SDStorage` + +```cpp +public SDStorage() +``` Default constructor for the [SDStorage](#class_s_d_storage) class.
-### `public virtual bool ` [`begin`](#class_s_d_storage_1ab49c772b785b6c97940baca60ae386ec)`()` +### `begin` + +```cpp +public virtual bool begin() +``` Initializes the SD card storage. @@ -533,7 +713,11 @@ Initializes the SD card storage. true if successful, false if failed.
-### `public virtual bool ` [`begin`](#class_s_d_storage_1a19520df98c5a52d403ac26a873f65860)`(FileSystems fs)` +### `begin` + +```cpp +public virtual bool begin(FileSystems fs) +``` Initializes the SD card storage with the specified file system. @@ -544,7 +728,11 @@ Initializes the SD card storage with the specified file system. true if successful, false if failed.
-### `public virtual bool ` [`unmount`](#class_s_d_storage_1a6f4d671e685d660d0aff8648d8288b9c)`()` +### `unmount` + +```cpp +public virtual bool unmount() +``` Unmounts the SD card storage. @@ -552,7 +740,11 @@ Unmounts the SD card storage. true if successful, false if failed.
-### `public virtual ` [`Folder`](#class_folder)` ` [`getRootFolder`](#class_s_d_storage_1a2f7327c327985d88bd1305310ec0c5e8)`()` +### `getRootFolder` + +```cpp +public virtual Folder getRootFolder() +``` Retrieves the root folder of the SD card storage. @@ -560,7 +752,11 @@ Retrieves the root folder of the SD card storage. The root folder as a [Folder](#class_folder) object.
-### `public virtual bool ` [`format`](#class_s_d_storage_1a93cac8330a5950138985e3712db1dc07)`(FileSystems fs)` +### `format` + +```cpp +public virtual bool format(FileSystems fs) +``` Formats the SD card storage with the selected file system. @@ -576,44 +772,52 @@ Class representing a File Members | Descriptions --------------------------------|--------------------------------------------- -`public ` [`UFile`](#class_u_file_1a2a04504d0135d28465e0547bec062ebf)`()` | Constructor. -`public ` [`UFile`](#class_u_file_1acdd969b1c2f115fc105f6d08bd67b121)`(const char * path)` | Constructor. -`public ` [`~UFile`](#class_u_file_1a4f74e28f98898e3603140b6409fa52ba)`()` | -`public bool ` [`changeMode`](#class_u_file_1a744ad88f2037e87e3f5375c7aec28f6d)`(FileMode mode)` | Closes the file, and opens it again with a new file mode. -`public bool ` [`open`](#class_u_file_1aa52ff2913386374e6e83ba35f595d213)`(const char * filename, FileMode mode)` | Opens a file with the specified mode. -`public bool ` [`open`](#class_u_file_1a0247abf7053b47463f73ca8cb1c7c23c)`(String filename, FileMode mode)` | Opens a file with the specified mode. -`public void ` [`close`](#class_u_file_1ab5731b8e40a87a44a7322bf151597c55)`()` | Closes the file and releases any allocated resources. -`public bool ` [`seek`](#class_u_file_1aa117a19e5efe6508e5e87ab65abbb560)`(size_t offset)` | Seeks to a specific position in the file. -`public size_t ` [`read`](#class_u_file_1a8192f041831d58ba8186798676c5ad3a)`(uint8_t * buffer, size_t size)` | Reads data from the file into a buffer. -`public String ` [`readAsString`](#class_u_file_1ad70a29b0e436906bdaa7b99e3fc9e1b3)`()` | Reads the contents of the file as an Arduino String. -`public size_t ` [`write`](#class_u_file_1a16625e123db35bf19f9088828d9e1305)`(const uint8_t * buffer, size_t size)` | Writes data to the file from a buffer. -`public size_t ` [`write`](#class_u_file_1a68ee9ecdb0a6efd9816f3382de67905e)`(String)` | Writes a string to the file. -`public bool ` [`remove`](#class_u_file_1a0e9efb7c54053b6f507f6caa704fc101)`()` | Removes the file. -`public bool ` [`rename`](#class_u_file_1a0511c1a498bcbce549b49db9e188c2c0)`(const char * newFilename)` | Renames the file. -`public bool ` [`rename`](#class_u_file_1a2122cd3e0e16481ecaff1af897790c03)`(String newFilename)` | Renames the file. -`public bool ` [`exists`](#class_u_file_1a4963afa70289718a3bd1ca50b6adb420)`()` | Checks if the file exists. -`public bool ` [`copyTo`](#class_u_file_1a6178616dea1a897b0e4033dfdc7bc41d)`(const char * destinationPath, bool overwrite)` | Copies the file to the specified destination path. -`public bool ` [`copyTo`](#class_u_file_1a908edbee6d38619798d63f72f8f58dd1)`(String destinationPath, bool overwrite)` | Copies the file to the specified destination path. -`public bool ` [`copyTo`](#class_u_file_1a9e06719446533b73505a6f6a66091fa7)`(` [`Folder`](#class_folder)` destinationFolder, bool overwrite)` | Copies the file to the specified destination path. -`public bool ` [`moveTo`](#class_u_file_1abadd4af5700d94b2c3d74dd4dce51bdc)`(const char * destinationPath, bool overwrite)` | Moves the file to the specified destination path. -`public bool ` [`moveTo`](#class_u_file_1ae676e42f3e5ad423da3386985fc8261f)`(String destinationPath, bool overwrite)` | Moves the file to the specified destination path. -`public bool ` [`moveTo`](#class_u_file_1a69f6a7cccce8cc40eb6698df15f38635)`(` [`Folder`](#class_folder)` destinationFolder, bool overwrite)` | Copies the file to the specified destination folder. -`public ` [`Folder`](#class_folder)` ` [`getParentFolder`](#class_u_file_1a087b79b6d62a3ed122d1f8b0f25b0d24)`()` | Returns a reference to the parent folder of the current folder. -`public const char * ` [`getPath`](#class_u_file_1a41592023ea53cd1b46f383097a3db1f8)`()` | Returns the path of the directory. -`public String ` [`getPathAsString`](#class_u_file_1a5adef9f3d538f92e51e52c4b1f3ada76)`()` | Returns the path of the directory. -`public uint32_t ` [`available`](#class_u_file_1a82ad0fb6cffaf23aea794b508ec57bbb)`()` | Returns the number of bytes available to read. -`public int ` [`read`](#class_u_file_1a62b544ebe9c3b144268016e6427917b5)`()` | Returns one byte from the file. -`public size_t ` [`write`](#class_u_file_1a4db87498c1a4205145816c14df704de7)`(uint8_t value)` | Writes one byte to the file. +| [`UFile`](#class_u_file_1a2a04504d0135d28465e0547bec062ebf) | Constructor. | +| [`UFile`](#class_u_file_1acdd969b1c2f115fc105f6d08bd67b121) | Constructor. | +| [`~UFile`](#class_u_file_1a4f74e28f98898e3603140b6409fa52ba) | | +| [`changeMode`](#class_u_file_1a744ad88f2037e87e3f5375c7aec28f6d) | Closes the file, and opens it again with a new file mode. | +| [`open`](#class_u_file_1aa52ff2913386374e6e83ba35f595d213) | Opens a file with the specified mode. | +| [`open`](#class_u_file_1a0247abf7053b47463f73ca8cb1c7c23c) | Opens a file with the specified mode. | +| [`close`](#class_u_file_1ab5731b8e40a87a44a7322bf151597c55) | Closes the file and releases any allocated resources. | +| [`seek`](#class_u_file_1aa117a19e5efe6508e5e87ab65abbb560) | Seeks to a specific position in the file. | +| [`read`](#class_u_file_1a8192f041831d58ba8186798676c5ad3a) | Reads data from the file into a buffer. | +| [`readAsString`](#class_u_file_1ad70a29b0e436906bdaa7b99e3fc9e1b3) | Reads the contents of the file as an Arduino String. | +| [`write`](#class_u_file_1a16625e123db35bf19f9088828d9e1305) | Writes data to the file from a buffer. | +| [`write`](#class_u_file_1a68ee9ecdb0a6efd9816f3382de67905e) | Writes a string to the file. | +| [`remove`](#class_u_file_1a0e9efb7c54053b6f507f6caa704fc101) | Removes the file. | +| [`rename`](#class_u_file_1a0511c1a498bcbce549b49db9e188c2c0) | Renames the file. | +| [`rename`](#class_u_file_1a2122cd3e0e16481ecaff1af897790c03) | Renames the file. | +| [`exists`](#class_u_file_1a4963afa70289718a3bd1ca50b6adb420) | Checks if the file exists. | +| [`copyTo`](#class_u_file_1a6178616dea1a897b0e4033dfdc7bc41d) | Copies the file to the specified destination path. | +| [`copyTo`](#class_u_file_1a908edbee6d38619798d63f72f8f58dd1) | Copies the file to the specified destination path. | +| [`copyTo`](#class_u_file_1a9e06719446533b73505a6f6a66091fa7) | Copies the file to the specified destination path. | +| [`moveTo`](#class_u_file_1abadd4af5700d94b2c3d74dd4dce51bdc) | Moves the file to the specified destination path. | +| [`moveTo`](#class_u_file_1ae676e42f3e5ad423da3386985fc8261f) | Moves the file to the specified destination path. | +| [`moveTo`](#class_u_file_1a69f6a7cccce8cc40eb6698df15f38635) | Copies the file to the specified destination folder. | +| [`getParentFolder`](#class_u_file_1a087b79b6d62a3ed122d1f8b0f25b0d24) | Returns a reference to the parent folder of the current folder. | +| [`getPath`](#class_u_file_1a122edcf553a8929b703d70c6aa8a6e80) | Returns the path of the directory. | +| [`getPathAsString`](#class_u_file_1a5adef9f3d538f92e51e52c4b1f3ada76) | Returns the path of the directory. | +| [`available`](#class_u_file_1a82ad0fb6cffaf23aea794b508ec57bbb) | Returns the number of bytes available to read. | +| [`read`](#class_u_file_1a62b544ebe9c3b144268016e6427917b5) | Returns one byte from the file. | +| [`write`](#class_u_file_1a4db87498c1a4205145816c14df704de7) | Writes one byte to the file. | ## Members -### `public ` [`UFile`](#class_u_file_1a2a04504d0135d28465e0547bec062ebf)`()` +### `UFile` + +```cpp +public UFile() +``` Constructor.
-### `public ` [`UFile`](#class_u_file_1acdd969b1c2f115fc105f6d08bd67b121)`(const char * path)` +### `UFile` + +```cpp +public UFile(const char * path) +``` Constructor. @@ -621,11 +825,19 @@ Constructor. * `const` char * path - path of the file
-### `public ` [`~UFile`](#class_u_file_1a4f74e28f98898e3603140b6409fa52ba)`()` +### `~UFile` + +```cpp +public ~UFile() +```
-### `public bool ` [`changeMode`](#class_u_file_1a744ad88f2037e87e3f5375c7aec28f6d)`(FileMode mode)` +### `changeMode` + +```cpp +public bool changeMode(FileMode mode) +``` Closes the file, and opens it again with a new file mode. @@ -636,7 +848,11 @@ Closes the file, and opens it again with a new file mode. True if operation was successful, false otherwise.
-### `public bool ` [`open`](#class_u_file_1aa52ff2913386374e6e83ba35f595d213)`(const char * filename, FileMode mode)` +### `open` + +```cpp +public bool open(const char * filename, FileMode mode) +``` Opens a file with the specified mode. @@ -649,7 +865,11 @@ Opens a file with the specified mode. True if the file was opened successfully, false otherwise.
-### `public bool ` [`open`](#class_u_file_1a0247abf7053b47463f73ca8cb1c7c23c)`(String filename, FileMode mode)` +### `open` + +```cpp +public bool open(String filename, FileMode mode) +``` Opens a file with the specified mode. @@ -662,13 +882,21 @@ Opens a file with the specified mode. True if the file was opened successfully, false otherwise.
-### `public void ` [`close`](#class_u_file_1ab5731b8e40a87a44a7322bf151597c55)`()` +### `close` + +```cpp +public void close() +``` Closes the file and releases any allocated resources.
-### `public bool ` [`seek`](#class_u_file_1aa117a19e5efe6508e5e87ab65abbb560)`(size_t offset)` +### `seek` + +```cpp +public bool seek(size_t offset) +``` Seeks to a specific position in the file. @@ -679,7 +907,11 @@ Seeks to a specific position in the file. True if the seek operation was successful, false otherwise.
-### `public size_t ` [`read`](#class_u_file_1a8192f041831d58ba8186798676c5ad3a)`(uint8_t * buffer, size_t size)` +### `read` + +```cpp +public size_t read(uint8_t * buffer, size_t size) +``` Reads data from the file into a buffer. @@ -692,7 +924,11 @@ Reads data from the file into a buffer. The number of bytes read from the file.
-### `public String ` [`readAsString`](#class_u_file_1ad70a29b0e436906bdaa7b99e3fc9e1b3)`()` +### `readAsString` + +```cpp +public String readAsString() +``` Reads the contents of the file as an Arduino String. @@ -700,7 +936,11 @@ Reads the contents of the file as an Arduino String. The file contents as a String.
-### `public size_t ` [`write`](#class_u_file_1a16625e123db35bf19f9088828d9e1305)`(const uint8_t * buffer, size_t size)` +### `write` + +```cpp +public size_t write(const uint8_t * buffer, size_t size) +``` Writes data to the file from a buffer. @@ -713,7 +953,11 @@ Writes data to the file from a buffer. The number of bytes written to the file.
-### `public size_t ` [`write`](#class_u_file_1a68ee9ecdb0a6efd9816f3382de67905e)`(String)` +### `write` + +```cpp +public size_t write(String) +``` Writes a string to the file. @@ -724,7 +968,11 @@ Writes a string to the file. The number of bytes written to the file.
-### `public bool ` [`remove`](#class_u_file_1a0e9efb7c54053b6f507f6caa704fc101)`()` +### `remove` + +```cpp +public bool remove() +``` Removes the file. @@ -732,7 +980,11 @@ Removes the file. True if the file was removed successfully, false otherwise.
-### `public bool ` [`rename`](#class_u_file_1a0511c1a498bcbce549b49db9e188c2c0)`(const char * newFilename)` +### `rename` + +```cpp +public bool rename(const char * newFilename) +``` Renames the file. @@ -743,7 +995,11 @@ Renames the file. True if the file was renamed successfully, false otherwise.
-### `public bool ` [`rename`](#class_u_file_1a2122cd3e0e16481ecaff1af897790c03)`(String newFilename)` +### `rename` + +```cpp +public bool rename(String newFilename) +``` Renames the file. @@ -754,7 +1010,11 @@ Renames the file. True if the file was renamed successfully, false otherwise.
-### `public bool ` [`exists`](#class_u_file_1a4963afa70289718a3bd1ca50b6adb420)`()` +### `exists` + +```cpp +public bool exists() +``` Checks if the file exists. @@ -762,7 +1022,11 @@ Checks if the file exists. True if the file exists, false otherwise.
-### `public bool ` [`copyTo`](#class_u_file_1a6178616dea1a897b0e4033dfdc7bc41d)`(const char * destinationPath, bool overwrite)` +### `copyTo` + +```cpp +public bool copyTo(const char * destinationPath, bool overwrite) +``` Copies the file to the specified destination path. @@ -773,7 +1037,11 @@ Copies the file to the specified destination path. True upon success, false otherwise.
-### `public bool ` [`copyTo`](#class_u_file_1a908edbee6d38619798d63f72f8f58dd1)`(String destinationPath, bool overwrite)` +### `copyTo` + +```cpp +public bool copyTo(String destinationPath, bool overwrite) +``` Copies the file to the specified destination path. @@ -784,7 +1052,11 @@ Copies the file to the specified destination path. True upon success, false otherwise.
-### `public bool ` [`copyTo`](#class_u_file_1a9e06719446533b73505a6f6a66091fa7)`(` [`Folder`](#class_folder)` destinationFolder, bool overwrite)` +### `copyTo` + +```cpp +public bool copyTo( Folder destinationFolder, bool overwrite) +``` Copies the file to the specified destination path. @@ -795,7 +1067,11 @@ Copies the file to the specified destination path. True upon success, false otherwise.
-### `public bool ` [`moveTo`](#class_u_file_1abadd4af5700d94b2c3d74dd4dce51bdc)`(const char * destinationPath, bool overwrite)` +### `moveTo` + +```cpp +public bool moveTo(const char * destinationPath, bool overwrite) +``` Moves the file to the specified destination path. @@ -806,7 +1082,11 @@ Moves the file to the specified destination path. True upon success, false otherwise.
-### `public bool ` [`moveTo`](#class_u_file_1ae676e42f3e5ad423da3386985fc8261f)`(String destinationPath, bool overwrite)` +### `moveTo` + +```cpp +public bool moveTo(String destinationPath, bool overwrite) +``` Moves the file to the specified destination path. @@ -817,7 +1097,11 @@ Moves the file to the specified destination path. True upon success, false otherwise.
-### `public bool ` [`moveTo`](#class_u_file_1a69f6a7cccce8cc40eb6698df15f38635)`(` [`Folder`](#class_folder)` destinationFolder, bool overwrite)` +### `moveTo` + +```cpp +public bool moveTo( Folder destinationFolder, bool overwrite) +``` Copies the file to the specified destination folder. @@ -828,7 +1112,11 @@ Copies the file to the specified destination folder. True upon success, false otherwise.
-### `public ` [`Folder`](#class_folder)` ` [`getParentFolder`](#class_u_file_1a087b79b6d62a3ed122d1f8b0f25b0d24)`()` +### `getParentFolder` + +```cpp +public Folder getParentFolder() +``` Returns a reference to the parent folder of the current folder. @@ -836,7 +1124,11 @@ Returns a reference to the parent folder of the current folder. A directory object representing the current folder.
-### `public const char * ` [`getPath`](#class_u_file_1a41592023ea53cd1b46f383097a3db1f8)`()` +### `getPath` + +```cpp +public const char * getPath() +``` Returns the path of the directory. @@ -844,7 +1136,11 @@ Returns the path of the directory. The path of the file as a const char *
-### `public String ` [`getPathAsString`](#class_u_file_1a5adef9f3d538f92e51e52c4b1f3ada76)`()` +### `getPathAsString` + +```cpp +public String getPathAsString() +``` Returns the path of the directory. @@ -852,7 +1148,11 @@ Returns the path of the directory. The path of the file as a String
-### `public uint32_t ` [`available`](#class_u_file_1a82ad0fb6cffaf23aea794b508ec57bbb)`()` +### `available` + +```cpp +public uint32_t available() +``` Returns the number of bytes available to read. @@ -860,7 +1160,11 @@ Returns the number of bytes available to read. The number of bytes available to read as int
-### `public int ` [`read`](#class_u_file_1a62b544ebe9c3b144268016e6427917b5)`()` +### `read` + +```cpp +public int read() +``` Returns one byte from the file. @@ -868,7 +1172,11 @@ Returns one byte from the file. An int representing one byte from the file
-### `public size_t ` [`write`](#class_u_file_1a4db87498c1a4205145816c14df704de7)`(uint8_t value)` +### `write` + +```cpp +public size_t write(uint8_t value) +``` Writes one byte to the file. @@ -889,26 +1197,34 @@ class USBStorage Members | Descriptions --------------------------------|--------------------------------------------- -`public ` [`USBStorage`](#class_u_s_b_storage_1ad084f3bd2479b0a1daa88013f3cfe23a)`()` | Default constructor for the [USBStorage](#class_u_s_b_storage) class. -`public virtual bool ` [`begin`](#class_u_s_b_storage_1aabf0868054a1741ffe4018301d145cb1)`()` | Initializes the USB storage. -`public virtual bool ` [`begin`](#class_u_s_b_storage_1a9fac27a863b6d73bb78f956be4517f67)`(FileSystems fs)` | Initializes the USB storage with the specified file system. -`public virtual bool ` [`unmount`](#class_u_s_b_storage_1acb602dc07465880ebaec64dca1b36506)`()` | Unmounts the USB storage. -`public virtual ` [`Folder`](#class_folder)` ` [`getRootFolder`](#class_u_s_b_storage_1a1d39336ddd7ec401dc2ed99c3117af59)`()` | Retrieves the root folder of the USB storage. -`public virtual bool ` [`format`](#class_u_s_b_storage_1a8aec32e4e48d081183ad880a61836bc5)`(FileSystems fs)` | Formats the USB storage with the selected file system. -`public bool ` [`isMounted`](#class_u_s_b_storage_1a2d3e3a732f2a43ab67e2fcd05e4ac058)`()` | Checks if the USB storage is mounted. -`public void ` [`onConnect`](#class_u_s_b_storage_1a1dfb2b9dde7fbdc26c0bf73be9babe25)`(void(*)() callbackFunction)` | Sets the callback function to be called when a USB connection is established. -`public void ` [`removeOnConnectCallback`](#class_u_s_b_storage_1afc58782a3f5207356d29392cb31730a0)`()` | Removes the callback function that is executed when the USB storage device is connected. -`public void ` [`onDisconnect`](#class_u_s_b_storage_1a10ac0c8965eee6041b384a4823bb9720)`(void(*)() callbackFunction)` | Sets a callback function to be called when the USB storage device is disconnected. -`public void ` [`removeOnDisconnectCallback`](#class_u_s_b_storage_1a2333fb1697b7ca72e5127cf60fc6680f)`()` | Removes the callback function that is called when the USB storage device is disconnected. +| [`USBStorage`](#class_u_s_b_storage_1ad084f3bd2479b0a1daa88013f3cfe23a) | Default constructor for the [USBStorage](#class_u_s_b_storage) class. | +| [`begin`](#class_u_s_b_storage_1aabf0868054a1741ffe4018301d145cb1) | Initializes the USB storage. | +| [`begin`](#class_u_s_b_storage_1a9fac27a863b6d73bb78f956be4517f67) | Initializes the USB storage with the specified file system. | +| [`unmount`](#class_u_s_b_storage_1acb602dc07465880ebaec64dca1b36506) | Unmounts the USB storage. | +| [`getRootFolder`](#class_u_s_b_storage_1a1d39336ddd7ec401dc2ed99c3117af59) | Retrieves the root folder of the USB storage. | +| [`format`](#class_u_s_b_storage_1a8aec32e4e48d081183ad880a61836bc5) | Formats the USB storage with the selected file system. | +| [`isMounted`](#class_u_s_b_storage_1a2d3e3a732f2a43ab67e2fcd05e4ac058) | Checks if the USB storage is mounted. | +| [`onConnect`](#class_u_s_b_storage_1a1dfb2b9dde7fbdc26c0bf73be9babe25) | Sets the callback function to be called when a USB connection is established. | +| [`removeOnConnectCallback`](#class_u_s_b_storage_1afc58782a3f5207356d29392cb31730a0) | Removes the callback function that is executed when the USB storage device is connected. | +| [`onDisconnect`](#class_u_s_b_storage_1a10ac0c8965eee6041b384a4823bb9720) | Sets a callback function to be called when the USB storage device is disconnected. | +| [`removeOnDisconnectCallback`](#class_u_s_b_storage_1a2333fb1697b7ca72e5127cf60fc6680f) | Removes the callback function that is called when the USB storage device is disconnected. | ## Members -### `public ` [`USBStorage`](#class_u_s_b_storage_1ad084f3bd2479b0a1daa88013f3cfe23a)`()` +### `USBStorage` + +```cpp +public USBStorage() +``` Default constructor for the [USBStorage](#class_u_s_b_storage) class.
-### `public virtual bool ` [`begin`](#class_u_s_b_storage_1aabf0868054a1741ffe4018301d145cb1)`()` +### `begin` + +```cpp +public virtual bool begin() +``` Initializes the USB storage. @@ -916,7 +1232,11 @@ Initializes the USB storage. true if successful, false if failed.
-### `public virtual bool ` [`begin`](#class_u_s_b_storage_1a9fac27a863b6d73bb78f956be4517f67)`(FileSystems fs)` +### `begin` + +```cpp +public virtual bool begin(FileSystems fs) +``` Initializes the USB storage with the specified file system. @@ -927,7 +1247,11 @@ Initializes the USB storage with the specified file system. true if successful, false if failed.
-### `public virtual bool ` [`unmount`](#class_u_s_b_storage_1acb602dc07465880ebaec64dca1b36506)`()` +### `unmount` + +```cpp +public virtual bool unmount() +``` Unmounts the USB storage. @@ -935,7 +1259,11 @@ Unmounts the USB storage. true if successful, false if failed.
-### `public virtual ` [`Folder`](#class_folder)` ` [`getRootFolder`](#class_u_s_b_storage_1a1d39336ddd7ec401dc2ed99c3117af59)`()` +### `getRootFolder` + +```cpp +public virtual Folder getRootFolder() +``` Retrieves the root folder of the USB storage. @@ -943,7 +1271,11 @@ Retrieves the root folder of the USB storage. The root folder as a [Folder](#class_folder) object.
-### `public virtual bool ` [`format`](#class_u_s_b_storage_1a8aec32e4e48d081183ad880a61836bc5)`(FileSystems fs)` +### `format` + +```cpp +public virtual bool format(FileSystems fs) +``` Formats the USB storage with the selected file system. @@ -951,7 +1283,11 @@ Formats the USB storage with the selected file system. true if successful, false if failed.
-### `public bool ` [`isMounted`](#class_u_s_b_storage_1a2d3e3a732f2a43ab67e2fcd05e4ac058)`()` +### `isMounted` + +```cpp +public bool isMounted() +``` Checks if the USB storage is mounted. @@ -959,7 +1295,11 @@ Checks if the USB storage is mounted. true if mounted, false otherwise.
-### `public void ` [`onConnect`](#class_u_s_b_storage_1a1dfb2b9dde7fbdc26c0bf73be9babe25)`(void(*)() callbackFunction)` +### `onConnect` + +```cpp +public void onConnect(void(*)() callbackFunction) +``` Sets the callback function to be called when a USB connection is established. @@ -967,13 +1307,21 @@ Sets the callback function to be called when a USB connection is established. * `callbackFunction` A pointer to the function to be called when a USB connection is established.
-### `public void ` [`removeOnConnectCallback`](#class_u_s_b_storage_1afc58782a3f5207356d29392cb31730a0)`()` +### `removeOnConnectCallback` + +```cpp +public void removeOnConnectCallback() +``` Removes the callback function that is executed when the USB storage device is connected.
-### `public void ` [`onDisconnect`](#class_u_s_b_storage_1a10ac0c8965eee6041b384a4823bb9720)`(void(*)() callbackFunction)` +### `onDisconnect` + +```cpp +public void onDisconnect(void(*)() callbackFunction) +``` Sets a callback function to be called when the USB storage device is disconnected. @@ -981,7 +1329,11 @@ Sets a callback function to be called when the USB storage device is disconnecte * `callbackFunction` A pointer to the function to be called when the USB storage device is disconnected.
-### `public void ` [`removeOnDisconnectCallback`](#class_u_s_b_storage_1a2333fb1697b7ca72e5127cf60fc6680f)`()` +### `removeOnDisconnectCallback` + +```cpp +public void removeOnDisconnectCallback() +``` Removes the callback function that is called when the USB storage device is disconnected. @@ -993,15 +1345,24 @@ Removes the callback function that is called when the USB storage device is disc Members | Descriptions --------------------------------|--------------------------------------------- -`public int ` [`size`](#struct_partition_1a718bdba639f222d90d23480b58caa1f9) | -`public FileSystems ` [`fileSystemType`](#struct_partition_1af5c05bc6faa14fb253c3a39e5e883529) | +| [`size`](#struct_partition_1a718bdba639f222d90d23480b58caa1f9) | | +| [`fileSystemType`](#struct_partition_1af5c05bc6faa14fb253c3a39e5e883529) | | ## Members -### `public int ` [`size`](#struct_partition_1a718bdba639f222d90d23480b58caa1f9) +### `size` + +```cpp +public int size +```
-### `public FileSystems ` [`fileSystemType`](#struct_partition_1af5c05bc6faa14fb253c3a39e5e883529) +### `fileSystemType` + +```cpp +public FileSystems fileSystemType +```
+