Move templated str_copy next to basic function

The functions were only separated because we previously had a large `extern "C"` block.
This commit is contained in:
Robert Müller 2023-06-13 21:08:59 +02:00
parent 9a57def5a6
commit 410ccda1c7

View file

@ -1227,6 +1227,23 @@ void str_append(char (&dst)[N], const char *src)
*/
int str_copy(char *dst, const char *src, int dst_size);
/**
* Copies a string to a fixed-size array of chars.
*
* @ingroup Strings
*
* @param dst Array that shall receive the string.
* @param src String to be copied.
*
* @remark The strings are treated as zero-terminated strings.
* @remark Guarantees that dst string will contain zero-termination.
*/
template<int N>
void str_copy(char (&dst)[N], const char *src)
{
str_copy(dst, src, N);
}
/**
* Truncates a utf8 encoded string to a given length.
*
@ -2797,23 +2814,6 @@ bool shell_unregister_application(const char *executable, bool *updated);
void shell_update();
#endif
/**
* Copies a string to a fixed-size array of chars.
*
* @ingroup Strings
*
* @param dst Array that shall receive the string.
* @param src String to be copied.
*
* @remark The strings are treated as zero-terminated strings.
* @remark Guarantees that dst string will contain zero-termination.
*/
template<int N>
void str_copy(char (&dst)[N], const char *src)
{
str_copy(dst, src, N);
}
template<>
struct std::hash<NETADDR>
{