@@ -34,10 +34,30 @@ enum class FormatStatus {
3434// ! OTHER_ERROR: another error occurred in an underlying function call
3535// ! Otherwise SUCCESS is returned. destination may be modified even in the case of an error.
3636// !
37- // ! \param destination: destination to fill with the formatted string.
37+ // ! \param destination: destination to fill with the formatted string
3838// ! \param maximumSize: size of the buffer represented by destination
3939// ! \param formatString: format string to fill
40- // ! \param args: variable arguments.
40+ // ! \param ...: variable arguments inputs
41+ // ! \return: SUCCESS on successful formatting, OVERFLOWED on overflow, and something else on any error
42+ FormatStatus stringFormat (char * destination, const FwSizeType maximumSize, const char * formatString, ...);
43+
44+ // ! \brief format a c-string
45+ // !
46+ // ! Format a string using printf family formatting semantics. Destination will be filled with the formatted string up to
47+ // ! maximumSize - 1. This function will always terminate the string with a \0.
48+ // !
49+ // ! This function can return several error codes:
50+ // ! OVERFLOWED: the complete string did not fit in the buffer with an appended null-terminator
51+ // ! INVALID_FORMAT_STRING: the format string was null
52+ // ! OTHER_ERROR: another error occurred in an underlying function call
53+ // ! Otherwise SUCCESS is returned. destination may be modified even in the case of an error.
54+ // !
55+ // ! This version take a variable argument list
56+ // !
57+ // ! \param destination: destination to fill with the formatted string
58+ // ! \param maximumSize: size of the buffer represented by destination
59+ // ! \param formatString: format string to fill
60+ // ! \param args: variable arguments list
4161// ! \return: SUCCESS on successful formatting, OVERFLOWED on overflow, and something else on any error
4262FormatStatus stringFormat (char * destination, const FwSizeType maximumSize, const char * formatString, va_list args);
4363}
0 commit comments