Add documentation to all API and utility methods #146

Open
opened 2024-12-01 08:04:03 +00:00 by lyricnz · 1 comment
lyricnz commented 2024-12-01 08:04:03 +00:00 (Migrated from github.com)

This will help developers reuse the existing code.

eg (for syntax, not content)

/**
 * Given an alignment string, return the corresponding alignment constant
 * 
 * @param alignment a 1-2 character string representing the alignment
 * @return the corresponding alignment constant
 */
int32_t Utils::stringToAlignment(String alignment) {
    alignment.toLowerCase();
    if (alignment.indexOf(" ") != -1) {
        alignment = alignment[0] + alignment.substring(alignment.indexOf(" ") + 1, 1);
    }

Shows up as a popup when the method is referenced:

image
This will help developers reuse the existing code. eg (for syntax, not content) ```c /** * Given an alignment string, return the corresponding alignment constant * * @param alignment a 1-2 character string representing the alignment * @return the corresponding alignment constant */ int32_t Utils::stringToAlignment(String alignment) { alignment.toLowerCase(); if (alignment.indexOf(" ") != -1) { alignment = alignment[0] + alignment.substring(alignment.indexOf(" ") + 1, 1); } ``` Shows up as a popup when the method is referenced: <img width="731" alt="image" src="https://github.com/user-attachments/assets/17a95621-b4c9-4388-a2fb-8a0799e65079">
lyricnz commented 2024-12-01 08:17:53 +00:00 (Migrated from github.com)

This could also be used to generate API docs, class diagrams, etc
https://www.doxygen.nl/

This could also be used to generate API docs, class diagrams, etc https://www.doxygen.nl/
Sign in to join this conversation.
No description provided.