From 70e39d375e289cd187e67972b18f189fd923f4de Mon Sep 17 00:00:00 2001 From: Foucher Alexandre Date: Tue, 23 Jan 2024 17:43:24 +0100 Subject: [PATCH] Working cpp documentation breathe + exhale --- cpp-example/include/Driver.h | 20 ++++++++++++++++++++ cpp-example/include/driver.h | 12 ------------ cpp-example/readme.md | 4 ++-- cpp-example/src/Driver.cpp | 8 ++++++++ cpp-example/src/driver.cpp | 6 ------ cpp-example/src/main.cpp | 2 +- 6 files changed, 31 insertions(+), 21 deletions(-) create mode 100644 cpp-example/include/Driver.h delete mode 100644 cpp-example/include/driver.h create mode 100644 cpp-example/src/Driver.cpp delete mode 100644 cpp-example/src/driver.cpp diff --git a/cpp-example/include/Driver.h b/cpp-example/include/Driver.h new file mode 100644 index 0000000..cb2a901 --- /dev/null +++ b/cpp-example/include/Driver.h @@ -0,0 +1,20 @@ +/** @file */ + +/** + * @class Driver + * @brief Driver example + */ +class Driver +{ +public: + /** + * @brief Write byte to a sensor + * + * @param[in] buffer description of parameter1 + * @return status return the termination status + */ + int write(unsigned char *buffer); + +private: + bool mIsActive; +}; \ No newline at end of file diff --git a/cpp-example/include/driver.h b/cpp-example/include/driver.h deleted file mode 100644 index d5b17de..0000000 --- a/cpp-example/include/driver.h +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @file driver.h - */ - -/** @brief function short description - * - * function longer description if need - * @param[in] x description of parameter1 - * @param[in] y description of parameter2 - * @return return_name return description - */ -int add(int x, int y); \ No newline at end of file diff --git a/cpp-example/readme.md b/cpp-example/readme.md index 2d96120..34818e1 100644 --- a/cpp-example/readme.md +++ b/cpp-example/readme.md @@ -7,11 +7,11 @@ ## :wrench: Dependencies installation ```sh -pip3 install sphinx breathe +pip3 install sphinx breathe exhale sudo apt-get install doxygen ``` -## :rocket: Compile documentation +## :rocket: Générer la documentation ```sh cd docs diff --git a/cpp-example/src/Driver.cpp b/cpp-example/src/Driver.cpp new file mode 100644 index 0000000..9d59c98 --- /dev/null +++ b/cpp-example/src/Driver.cpp @@ -0,0 +1,8 @@ +#include "Driver.h" + + +int Driver::write(unsigned char *buffer) +{ + // Do something + return 0; +} \ No newline at end of file diff --git a/cpp-example/src/driver.cpp b/cpp-example/src/driver.cpp deleted file mode 100644 index 8fdf02b..0000000 --- a/cpp-example/src/driver.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "driver.h" - -int add(int x, int y) -{ - return x + y; -} \ No newline at end of file diff --git a/cpp-example/src/main.cpp b/cpp-example/src/main.cpp index 435aa6c..08dab59 100644 --- a/cpp-example/src/main.cpp +++ b/cpp-example/src/main.cpp @@ -1,6 +1,6 @@ #include -#include "driver.h" +#include "Driver.h" int main(int argc, char* argv[]) {