From 76ce32b4a76ebb2dc6eaf0205045a88a54752b72 Mon Sep 17 00:00:00 2001 From: Charlie Kushelevsky Date: Fri, 18 Oct 2024 09:19:55 -0700 Subject: [PATCH 1/3] docs: updated doc strings --- src/fileCLI/fileCLI.hpp | 45 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/fileCLI/fileCLI.hpp b/src/fileCLI/fileCLI.hpp index 2603d1be..40c18027 100644 --- a/src/fileCLI/fileCLI.hpp +++ b/src/fileCLI/fileCLI.hpp @@ -89,16 +89,54 @@ class FileCLI{ */ void mkdir(void); + /** + * @brief Indicates whether the CLI is running. + * + * @detailsWhen set to 1, the CLI continues running; when set to 0, + * the CLI exits. + */ int run = 1; + + /** + * @brief Stack of directory pointers for navigating through directories. + * + * @details This stack holds up to FILE_CLI_MAX_DIR_DEPTH directories. + */ DIR* dir_stack[FILE_CLI_MAX_DIR_DEPTH]; + + /** + * @brief Stack of paths corresponding to the directory stack. + * + * This stack holds the paths for the directories in the `dir_stack`. + */ char path_stack[FILE_CLI_MAX_DIR_DEPTH][NAME_MAX]; + /** + * @brief Index of the current directory in the directory stack. + * + * @details This integer represents the current position within + * the `dir_stack`. + */ int current_dir; + /** + * @brief typedef for a menu entry for fileCli. + * + * @details contains a command and a function for each entry + */ typedef struct menu_ { + //! Command character for the menu entry. const char cmd; + //! Function pointer to the command handler. void (FileCLI::*fn)(void); } menu_t; + + /** + * @brief Array of menu entries. + * + * @details This menu is used to handle various file operations in the CLI. + */ static menu_t fsExplorerMenu[]; + /** * @brief Finds the menu entry corresponding to the specified command string * @@ -106,6 +144,13 @@ class FileCLI{ * @return Pointer to menu entry if matching entry found, otherwise nullptr */ static menu_t* findCommand(const char* const cmd); + + /** + * @brief Constructs a path from the current directory stack. + * + * @param is_dir If true, the path is a directory path. + * @return const char* The constructed file or directory path. + */ const char* buildPath(bool is_dir); }; #endif From 2e1c969d799b693cd0e06f6387797ab4672527ec Mon Sep 17 00:00:00 2001 From: Charlie Kushelevsky Date: Fri, 18 Oct 2024 10:24:14 -0700 Subject: [PATCH 2/3] docs: updated doc strings --- src/fileCLI/fileCLI.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fileCLI/fileCLI.hpp b/src/fileCLI/fileCLI.hpp index 40c18027..4d10b3f5 100644 --- a/src/fileCLI/fileCLI.hpp +++ b/src/fileCLI/fileCLI.hpp @@ -92,7 +92,7 @@ class FileCLI{ /** * @brief Indicates whether the CLI is running. * - * @detailsWhen set to 1, the CLI continues running; when set to 0, + * @details When set to 1, the CLI continues running; when set to 0, * the CLI exits. */ int run = 1; From 384502ebe6096592adecbc78b9713f4ac200b71b Mon Sep 17 00:00:00 2001 From: charliekush Date: Mon, 3 Feb 2025 12:53:55 -0800 Subject: [PATCH 3/3] docs: updated doc strings --- src/fileCLI/fileCLI.hpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/fileCLI/fileCLI.hpp b/src/fileCLI/fileCLI.hpp index 4d10b3f5..c5aa86d1 100644 --- a/src/fileCLI/fileCLI.hpp +++ b/src/fileCLI/fileCLI.hpp @@ -92,8 +92,7 @@ class FileCLI{ /** * @brief Indicates whether the CLI is running. * - * @details When set to 1, the CLI continues running; when set to 0, - * the CLI exits. + * Set to 1, the CLI continues running; set to 0 the CLI exits. */ int run = 1; @@ -107,20 +106,14 @@ class FileCLI{ /** * @brief Stack of paths corresponding to the directory stack. * - * This stack holds the paths for the directories in the `dir_stack`. */ char path_stack[FILE_CLI_MAX_DIR_DEPTH][NAME_MAX]; /** * @brief Index of the current directory in the directory stack. - * - * @details This integer represents the current position within - * the `dir_stack`. */ int current_dir; /** * @brief typedef for a menu entry for fileCli. - * - * @details contains a command and a function for each entry */ typedef struct menu_ { @@ -132,8 +125,6 @@ class FileCLI{ /** * @brief Array of menu entries. - * - * @details This menu is used to handle various file operations in the CLI. */ static menu_t fsExplorerMenu[]; @@ -149,7 +140,8 @@ class FileCLI{ * @brief Constructs a path from the current directory stack. * * @param is_dir If true, the path is a directory path. - * @return const char* The constructed file or directory path. + * @return The constructed file or directory path. Returned buffer only + * valid until the next invocation of buildPath. */ const char* buildPath(bool is_dir); };